View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Inserting columns

Hi FinChase,

Try:
ActiveCell(1, 2).Resize(1, 2).EntireColumn.Insert

If the 26 positions can be identified by a given rule, then your macro could
be adapred to insert all the required columns on each worksheet.


---
Regards,
Norman

"FinChase" wrote in message
...
I have a number of spreadsheets where I need to go through and insert two
columns at 26 places in each spreadsheet. I'm trying to make this a
little
faster by writing a VBA macro that I can run with keystrokes. What I
tried
to do was tell it select the column that I am currently in and insert two
columns to the right of that column. The problem I am having is that it
is
inserting the columns to the left instead of the right. I can't figure
out
why. Here's the code I've written:

With ActiveCell
.EntireColumn.Select
End With
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight

Any help would be appreciated.