ctrl-key adds up to cells.count

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

This is about selecting multiple ranges in Excel using ctrl.

Say you click on A1, hold ctrl and click on A2, next A3, you have 3
cells selected. But if you accidentally click a second time on e.g.
A2, Selection.Cells.Count returns 4 and if you loop through the
elements within the Cells-collection, A2 is twice in it.
Is there a way to obtain all discrete cells from a range? I tried with
SpecialCells(xlCellTypeVisible) but no success.

tia,
Chris
 
Thanks a lot, Dave. I already found a solution looping through all
cells from the selection and storing unique cell addresses in an
array. But your (last) approach is a lot faster so I implemented it.
Great!
Chris
 
Back
Top