LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Inserting columns

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.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting columns GARY Excel Discussion (Misc queries) 2 August 13th 08 04:29 PM
VB EXCEL INSERTING COLUMNS moosedog2000 Excel Discussion (Misc queries) 2 July 25th 07 09:40 PM
inserting new columns CJ Excel Discussion (Misc queries) 5 September 16th 06 07:18 PM
Inserting columns into a row park Excel Discussion (Misc queries) 1 August 2nd 05 10:09 PM
Inserting Columns GJB Excel Worksheet Functions 1 January 20th 05 03:41 AM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"