View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GreenInIowa GreenInIowa is offline
external usenet poster
 
Posts: 38
Default Selecting columns through a loop

Hi,

I would like to select columns through loop so that all selected columns
would be highlighted (like CRTL+select operation) for operations later on.

Through recording Excel gave me this codes for the first three alternating
columns:
Sub Macro1( )
Range("B:B,D:D,F:F").Select
Range("F1").Activate
End Sub

I tried to write a code, but it would not hold the columns highlighted
(selected)! I was wondering what I am doing wrong. Thanks.

For i = 1 To 3
n = 2 * i
ActiveSheet.Columns(n).Select
Selection.Activate
Next
End Sub