A
Adrian
This works...
Sub test()
For Each cell In Selection
MsgBox cell.Column
Next
End Sub
But this does not work...
Sub test()
Set region = Selection
For Each cell In region
MsgBox cell.Column
Next
End Sub
I need my macro to work without selecting the cells I'm
working on, so please can someone explain/help?
(you'll understand that the above is a greatly simplified
piece of code that focuses on my problem.
In fact, "region" is the result of a fairly complicated
calculation, and I want to use both the .Value and .Column
of "cell" in the code within the loop.)
Sub test()
For Each cell In Selection
MsgBox cell.Column
Next
End Sub
But this does not work...
Sub test()
Set region = Selection
For Each cell In region
MsgBox cell.Column
Next
End Sub
I need my macro to work without selecting the cells I'm
working on, so please can someone explain/help?
(you'll understand that the above is a greatly simplified
piece of code that focuses on my problem.
In fact, "region" is the result of a fairly complicated
calculation, and I want to use both the .Value and .Column
of "cell" in the code within the loop.)