Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Format multiple sheets in VBA

Most grouping activities are not supported in VBA. As Doug has discovered,
this can sometimes be overcome by selecting a cell - however this has no
application to pagesetup. For page setup, you have to loop through the
sheets and make your settings on each one.

for each sh in Sheets("Array("sheet2", "sheet3", "sheet4")
With sh.PageSetup
.LeftFooter = "ABCD"
' etc
End With
Next

A trick recently posted by KeepItcool is to format one sheet, then transmit
this to the remaining

With Sheets("Sheet3").PageSetup
.LeftFooter = "ABCD"
'etc
End with
sheets(array("sheet2","sheet3","sheet4")).select
sheets("sheet3").activate
SendKeys "{enter}"
Application.Dialogs(xlDialogPageSetup).Show
Sheets("Sheet3").Select 'ungroups the sheets
--
Regards,
Tom Ogilvy



DrDave1958 wrote in message
...
If I turn on the macro recorder, then select sheets 3 thru 10 (group),

then go to file, page setup, and make the changes I desire, the changes are
applied to all sheets selected. When I run the VBA code I just recorded, it
only formats the active sheet. What am I doing wrong?

Thanks, Dave

Excel XP
Win XP



Reply
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
How to sort multiple sheets (which have same format) at one time? Crickett Excel Discussion (Misc queries) 2 April 3rd 23 04:32 PM
How to update data from multiple sheets to one specific sheets Khawajaanwar Excel Discussion (Misc queries) 4 January 15th 10 07:31 AM
can you print format multiple sheets in excel at once? Rigatoni Excel Discussion (Misc queries) 7 September 10th 09 08:47 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
Changing the value in multiple sheets without selecting those sheets herm Excel Programming 3 October 14th 03 03:50 PM


All times are GMT +1. The time now is 12:13 PM.

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"