Finding the Selection in an inactive worksheet
I've been writing in VBA for Excel for years, and I just now got around to noticing that there's no Selection property for a worksheet; I guess it's just for the ActiveWindow. Yet now that I see that, what I want is to have my program detect which cell(s) are selected in a worksheet that isn't necessarily active. Surely it can be done; Excel knows, after all, for when I return to the worksheet the same cells are selected there that were before. So how can my program determine that?
(I realize I can Activate the worksheet; and it isn't even all that important not to do it, as it might be if, for example, I had to do it many times in a loop with many worksheets. Still, there must be a way.)
|