G
Guest
I'd like to loop over all columns (or rows) in a non-contiguous selection in
one of my macros.
I can already do it rather easily for a contiguous column selection by
referencing the Selection.Column property and the Selection.Columns.Count
property as in the following ...
'get DataColumn information
FirstDataColumn = Selection.Column
LastDataColumn = FirstDataColumn + Selection.Columns.Count - 1
For k = FirstDataColumn To LastDataColumn
....
next k
I'd like to do the same thing for a non-contiguous column/row selection.
Any help would be greatly appreciated.
Thanks,
Jim
one of my macros.
I can already do it rather easily for a contiguous column selection by
referencing the Selection.Column property and the Selection.Columns.Count
property as in the following ...
'get DataColumn information
FirstDataColumn = Selection.Column
LastDataColumn = FirstDataColumn + Selection.Columns.Count - 1
For k = FirstDataColumn To LastDataColumn
....
next k
I'd like to do the same thing for a non-contiguous column/row selection.
Any help would be greatly appreciated.
Thanks,
Jim