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: 206
Default Insert Columns on Every Sheet

Hi All,

If I want to insert a new column A&B on every sheet in the workbook I
thought to run this sub:

Sub INSERT_COLUMNS()
Dim w As Worksheet
For Each w In ActiveWorkbook.Worksheets
Columns("A:B").Insert
Next w
End Sub

What it does:
On the active sheet it inserts 2 columns times the number of sheets in
the workbook.
So, if you have 5 worksheets...it inserts 10 columns on the active
sheet!

I am ashamed ...
What is wrong with the code ... / me?

Sige

 
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
Reference changes when I insert new columns in the source sheet John Bare Excel Discussion (Misc queries) 3 March 24th 10 04:02 PM
2007 excel work sheet will not allow to insert rows or columns David Excel Discussion (Misc queries) 1 January 24th 09 07:30 PM
can't insert a column, can't shift columns off the sheet. Janis Excel Discussion (Misc queries) 4 July 25th 07 07:26 PM
How to Insert Columns in a big Sheet... JV Excel Worksheet Functions 2 March 30th 07 07:42 PM
unable to insert columns in excel, insert- columns (disabled) iam_leearner Excel Discussion (Misc queries) 1 August 13th 06 02:26 PM


All times are GMT +1. The time now is 09:00 AM.

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

About Us

"It's about Microsoft Excel"