View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SIGE SIGE is offline
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