I want to start a routine by getting a range for each of the cells that the
user has selected by holding down the shift key or control key. I cannot
find a way to get a reference to these ranges?
Any ideas?
I want to start a routine by getting a range for each of the cells that the
user has selected by holding down the shift key or control key. I cannot
find a way to get a reference to these ranges?
Any ideas?
Hello mcgj,
Dim Address As String
Dim Cell
Dim Rng As Range
Dim Selections As Long
Set Rng = Application.Selection
Selections = Rng.Areas.Count
Address = Rng.Areas(1).Address
Selections will equal the number of cells selected. Zero indicates nothing was selected. You can use a For Each loop to sequence through automatically...
For Each Cell In Rng.Areas
'<Add in your code>
Next Cell
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks