Hi
Say, A1:A6 are to be selected but with 2 cells as a group, i.e. A1:A2,A3:A4,A5:A6
I tried
However, the result is A1:A6 being selected instead of 3 selection batches A1:A2, A3:A4 and A5:A6
The above is a simplified case of my scenario. I just wonder, if in general, there is a way for VBA to group selected contiguous cells by N number as a batch, and return contiguous selection as separate batches ( like what we select using Ctrl + MouseLeftClick on cells ).
Say, A1:A6 are to be selected but with 2 cells as a group, i.e. A1:A2,A3:A4,A5:A6
I tried
VBA Code:
With ActiveSheet
Union( .Range("A1:A2"), .Range("A3:A4"), Range("A5:A6")).Select
End With
However, the result is A1:A6 being selected instead of 3 selection batches A1:A2, A3:A4 and A5:A6
The above is a simplified case of my scenario. I just wonder, if in general, there is a way for VBA to group selected contiguous cells by N number as a batch, and return contiguous selection as separate batches ( like what we select using Ctrl + MouseLeftClick on cells ).