Reputation: 1794
I need to acquire range that is currently selected on some non-active worksheet. If I select some arbitrary range on e.g Sheet1 (A3:B5) and switch to Sheet2, selection will be changed, and if I return back to Sheet1 selection will return too (A3:B5)
I know about Selection property within Application interface, but that only returns selection of currently active sheet of currently active document.
Is there address of selected range, that will help too since I could use:
worksheet.get_Range(address);
Upvotes: 0
Views: 89
Reputation: 19087
There is nothing like selection
in sheet which is not active. I agree, when you move to any other sheet your selection will change to range which was selected when you left this sheet earlier. However, you are not able to check it if sheet is not active.
The only workaround I can think of is:
ScreenUpdating property
of applicationScreeUpdating
The other option would be to remember selection address each time you left sheet using string Public variable
and Sheet deactivate event
.
Upvotes: 2