LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Running Macro on every sheet in Workbook !!!

wks.Columns(1).Insert
With wks.Cells(1,1)
.Value = "Heading 1"
.font.Bold = True
End With
with wks.Range("W1").Resize(1,4)
.Value = Array( _
"Heading 2", "Heading 3", _
"Heading 4", "Heading 5")
.font.Bold = True
End With

wks.Cells.Interior.NumberFormat = "@"


--
Regards,
Tom Ogilvy


"Jako " wrote in message
...
Tom,
Thanks again but only the first worksheet is formatted as i need.
Here is the code i now have:



Sub all_sheets()
Dim wks As Worksheet
For Each wks In Worksheets
ChopAndChange wks
Next
End Sub

Sub ChopAndChange(wks As Worksheet)
wks.Range("C:C,G:G,I:I,K:M,P:R").EntireColumn.Hidd en = True
wks.Columns(1).Insert
With wks.Cells(1, 1)
Value = "Heading 1"
Font.Bold = True
End With
With Range("W1").Resize(1, 4)
Value = Array( _
"Heading 2", "Heading 3", _
"Heading 4", "Heading 5")
Font.Bold = True
End With


Sheets 2 & 3 have the 1st columns + "Heading 1" but not the
W - Z column changes.

TIA


---
Message posted from http://www.ExcelForum.com/



 
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
Running macro in another workbook Barb Reinhardt Excel Worksheet Functions 1 April 25th 07 08:30 PM
Help:Running a macro in one excel workbook from another workbook R Kapoor Setting up and Configuration of Excel 3 January 13th 06 05:11 AM
Running a macro in another workbook Blue Excel Programming 1 July 10th 04 04:04 PM
Running a macro in another workbook Blue Excel Programming 4 July 9th 04 07:38 PM
Running Code on Each Sheet in an Excel Workbook bearie Excel Programming 2 February 6th 04 03:54 PM


All times are GMT +1. The time now is 04:18 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"