J
joeu2004
I often myself writing algorithms wherein I want to reference "column N to
column M", where N and M are numbers. For example, I want to write:
Columns(N & ":" & M).Clear
Instead, I seem to have to write:
Range(Cells(1,N),Cells(1,M)).EntireColumn.Clear
Is that the best I can do? Or is there a more efficient way to refer a
range of columns by number?
PS: It seem odd that Columns(2) works, and the "quick info" editing tips
shows Columns(RowIndex,ColumnIndex), but Columns(2,3) does not work.
column M", where N and M are numbers. For example, I want to write:
Columns(N & ":" & M).Clear
Instead, I seem to have to write:
Range(Cells(1,N),Cells(1,M)).EntireColumn.Clear
Is that the best I can do? Or is there a more efficient way to refer a
range of columns by number?
PS: It seem odd that Columns(2) works, and the "quick info" editing tips
shows Columns(RowIndex,ColumnIndex), but Columns(2,3) does not work.