Determine Selected Cells
In a VBA macro how do I determine the current selected
range. I am sure this is trivial, but I am having no luck finding an example of code to do this. Thanks for any help. John |
Determine Selected Cells
John,
If you want to determine if a particular cell is selected, use something like If Not Intersect(Selection, Range("B99") Is Nothing Then ... or If Not Intersect(Selection, Range("B99:B100") Is Nothing Then ... -- HTH Bob Phillips "Jim Rech" wrote in message ... Perhaps you want something like this: MsgBox Selection.Address or MsgBox ActiveWindow.RangeSelection.Address The later for those rare occasions when the current selection is not a range, such as when an object is selected. -- Jim Rech Excel MVP |
Determine Selected Cells - Got it Thanks!
-----Original Message----- In a VBA macro how do I determine the current selected range. I am sure this is trivial, but I am having no luck finding an example of code to do this. Thanks for any help. John . |
All times are GMT +1. The time now is 05:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com