Take the 2-minute tour ×

My app needs to build a buffer from all the selected cells on a worksheet. I have it working correctly when the selected cells are all one contiguous group, but if the user selects a group of cells, then holds down the control key and selects other cells that are not contiguous to the first set of cells, the Worksheet's Selected range only gives me information on that first group of cells.

I tried the Range "Next" property, but walking that seems to just return ranges containing cell-by-cell traversal of that first range.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The Address property returns selected ranges (separated by comma)

When I select B4 to D10 and then H9 to 016 (by holding ctrl), Selection.Address returns $B$4:$D$10,$H$9:$O$16.

share|improve this answer

VBA Code

for i = 1 to selection.Areas.Count : debug.Print selection.areas(i).Address : next

share|improve this answer

Your Answer


