• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Select data of alternate column

pradhishnair

New Member
I have an excel files with huge amount of data. I need to select data of alternate columns. can anybody please help with this.
 
this will do it in VBA. Select all columns in the range you want then run macro

[pre]
Code:
Sub Select_alt_col()

Dim column_Let As String
Dim range_St As String
Dim i As Long

Dim firstCol, lastCol As Long
firstCol = Selection.Column
lastCol = Selection.Columns.Count + firstCol - 1

For i = firstCol To lastCol Step 2
column_Let = Chr(i + 64)
range_St = range_St & "," & column_Let & ":" & column_Let
Next i

range_St = Mid(range_St, 2)

Range(range_St).Select

End Sub
[/pre]
 
Back
Top