-1

I wrote a macro and calling from excel automatically. The macro is working only for Cell A1, I have played with range and tried different things to get the address of A2 or A3 so on but no success. We have range like A1:A30 and as user will give data I want macro to execute automatically and give result.

Here is the link where I can call macro one time or for 'A1' but how do I to use this macro for A1:A30? How to call VBA function from excel

4

1 回答 1

2

代替: If Target.Address = "$A$1" Then 'assumes user input cell is A1

有了这个: If Not Intersect(Target.Parent.Range("A1:A30"), Target) Is Nothing Then

并确保检查 Scott Holtzman 对您的其他问题的回答是否正确。

于 2012-12-15T18:51:49.713 回答