The code below selects every 2nd ROW in the selected range.
I cannot work out how to transform this code, so that it works for COLUMNS, also based on the selected range.
Any ideas?
I cannot work out how to transform this code, so that it works for COLUMNS, also based on the selected range.
Any ideas?
VBA Code:
Sub selecteveryotherrow()
Dim MyRange As Range
Dim RowSelect As Range
Dim i As Integer
Set MyRange = Selection
Set RowSelect = MyRange.Rows(1)
For i = 3 To MyRange.Rows.Count Step 2
Set RowSelect = Union(RowSelect, MyRange.Rows(i))
Next i
Application.Goto RowSelect
End Sub