From SelectionChange into UserForm
One way...
In a VBA module (Insert Module in the Visual Basic Editor), define a
global Range variable:
Global CurrRng as Range
In the Worksheet_SelectionChange event code, assign the Target range value
to CurrRng:
Set CurrRng = Target
Your userform code can use CurrRng like any other variable. Before you close
the workbook, you should free the memory used by CurrRng:
Set CurrRng = Nothing
Hope this helps,
Hutch
"Mac" wrote:
I've defined a UserForm in my worksheet and I also intercept the
Worksheet_SelectionChange; my question is - how do I get the Range variable
obtained via the Worksheet_SelectionChange method into the UserForm for
display? Tried adding a method to the form code and calling it with the Range
parameter from within Worksheet_SelectionChange, but this doesn't seem to
work ...
|