Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I've recorded a macro doing the following: group all worksheets, select file|pagesetup, and then select my formatting, etc. The formatting was successfully applied to all worksheets at this stage. However when I try to run the macro, the formatting is only applied to the first worksheet. What gives? Thanks. Allan |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Are you Twirly?
Can you use a macro? Option Explicit Sub testme() Dim wks As Worksheet For Each wks In ActiveWindow.SelectedSheets With wks .PageSetup.PrintArea = "A1:X99" End With Next wks End Sub You have to group the worksheets that should have the same print area before running the macro. Click on the first worksheet tab and ctrl-click on subsequent. And after, rightclick on one of the grouped sheets and select ungroup sheets. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm KonaAl wrote: Hi, I've recorded a macro doing the following: group all worksheets, select file|pagesetup, and then select my formatting, etc. The formatting was successfully applied to all worksheets at this stage. However when I try to run the macro, the formatting is only applied to the first worksheet. What gives? Thanks. Allan -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks so much Dave! -- works perfectly.
I'm not Twirly -- assuming that's a person! I'm familiar with macros but the whole for:next thing had me stumped when I looked through the help files. Thanks again. Allan "Dave Peterson" wrote: Are you Twirly? Can you use a macro? Option Explicit Sub testme() Dim wks As Worksheet For Each wks In ActiveWindow.SelectedSheets With wks .PageSetup.PrintArea = "A1:X99" End With Next wks End Sub You have to group the worksheets that should have the same print area before running the macro. Click on the first worksheet tab and ctrl-click on subsequent. And after, rightclick on one of the grouped sheets and select ungroup sheets. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm KonaAl wrote: Hi, I've recorded a macro doing the following: group all worksheets, select file|pagesetup, and then select my formatting, etc. The formatting was successfully applied to all worksheets at this stage. However when I try to run the macro, the formatting is only applied to the first worksheet. What gives? Thanks. Allan -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Twirly(?) asked a very similar question just moments before you did. In fact, I
essentially copied and pasted my reply. KonaAl wrote: Thanks so much Dave! -- works perfectly. I'm not Twirly -- assuming that's a person! I'm familiar with macros but the whole for:next thing had me stumped when I looked through the help files. Thanks again. Allan "Dave Peterson" wrote: Are you Twirly? Can you use a macro? Option Explicit Sub testme() Dim wks As Worksheet For Each wks In ActiveWindow.SelectedSheets With wks .PageSetup.PrintArea = "A1:X99" End With Next wks End Sub You have to group the worksheets that should have the same print area before running the macro. Click on the first worksheet tab and ctrl-click on subsequent. And after, rightclick on one of the grouped sheets and select ungroup sheets. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm KonaAl wrote: Hi, I've recorded a macro doing the following: group all worksheets, select file|pagesetup, and then select my formatting, etc. The formatting was successfully applied to all worksheets at this stage. However when I try to run the macro, the formatting is only applied to the first worksheet. What gives? Thanks. Allan -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Svaing as Web Page Problem | Excel Discussion (Misc queries) | |||
Page numbering problem | Excel Discussion (Misc queries) | |||
Is there a way to apply "page setup" defaults to an existing work. | Excel Discussion (Misc queries) | |||
can you set the "Page Setup" margins etc. differently for each pag | Excel Worksheet Functions | |||
How do I copy page setup from one worksheet & paste into new shee. | Excel Discussion (Misc queries) |