Inserting blank columns

P

poppy

Hi again

I am trying to insert a column into an excel sheet. Using VBA it read
like this:

'shift cells to right
Range("E:E,H:H,K:K,N:N,Q:Q,T:T,W:W,Z:Z,AC:AC,AF:AF,AI:AI").Select
Selection.Insert Shift:=xlToRight

I am trying to do this in VB this way. I am not sure of the syntax

For i = 2 To 31 Step 4
Selection.Insert Shift:=xlToRight
Next

Any one with the equivalent in VB would be appreciated
 
N

nath

-----Original Message-----
Hi again

I am trying to insert a column into an excel sheet. Using VBA it reads
like this:

'shift cells to right
Range ("E:E,H:H,K:K,N:N,Q:Q,T:T,W:W,Z:Z,AC:AC,AF:AF,AI:AI").Selec
t
Selection.Insert Shift:=xlToRight

I am trying to do this in VB this way. I am not sure of the syntax

For i = 2 To 31 Step 4
Selection.Insert Shift:=xlToRight
Next

Any one with the equivalent in VB would be appreciated.
(i).select, before your line which begins selection.
 
Top