Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Macro to Select All Sheets and Make Change to Footer

Hi, I need help with this code, please. I want to select all the sheets in
one workbook and change the right footer to nothing, then select the A1 on
the first worksheet. What am I missing? Thank you!

Worksheets.Select
PageSetup.RightFooter = ""
Sheets(1).Select
Range("A1").Select

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Macro to Select All Sheets and Make Change to Footer

There is a problem wiht doin a pagesetup to all sheets. VBA can only do it
one sheet at a time... Your code is equivalent to

Worksheets.Select
Activesheet.PageSetup.RightFooter = "" '**Activesheet only
Sheets(1).Select
Range("A1").Select

Try this... It does not select anything so your user will be left exactly
where they were when the started the macro.

Sub test()
Dim wks As Worksheet

For Each wks In Worksheets
wks.PageSetup.RightFooter = ""
Next wks
End Sub

--
HTH...

Jim Thomlinson


"Karin" wrote:

Hi, I need help with this code, please. I want to select all the sheets in
one workbook and change the right footer to nothing, then select the A1 on
the first worksheet. What am I missing? Thank you!

Worksheets.Select
PageSetup.RightFooter = ""
Sheets(1).Select
Range("A1").Select

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Macro to Select All Sheets and Make Change to Footer

It seems to go to next sheet and on from there without changing the sheet you
are on or the sheets before it.

"Jim Thomlinson" wrote:

There is a problem wiht doin a pagesetup to all sheets. VBA can only do it
one sheet at a time... Your code is equivalent to

Worksheets.Select
Activesheet.PageSetup.RightFooter = "" '**Activesheet only
Sheets(1).Select
Range("A1").Select

Try this... It does not select anything so your user will be left exactly
where they were when the started the macro.

Sub test()
Dim wks As Worksheet

For Each wks In Worksheets
wks.PageSetup.RightFooter = ""
Next wks
End Sub

--
HTH...

Jim Thomlinson


"Karin" wrote:

Hi, I need help with this code, please. I want to select all the sheets in
one workbook and change the right footer to nothing, then select the A1 on
the first worksheet. What am I missing? Thank you!

Worksheets.Select
PageSetup.RightFooter = ""
Sheets(1).Select
Range("A1").Select

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
Macro to select all sheets belvy123 Excel Discussion (Misc queries) 7 March 27th 08 09:43 PM
macro to select all sheets belvy123 Excel Discussion (Misc queries) 1 March 26th 08 04:23 PM
Macro to select and print sheets JoeP Excel Discussion (Misc queries) 3 April 19th 07 06:44 PM
I was asked to change excel spreadsheet to make multiple select yakov Excel Worksheet Functions 1 September 22nd 06 05:26 PM
how do i change footer settings on multiple sheets at the same ti. Chris Excel Worksheet Functions 1 March 29th 05 03:05 PM


All times are GMT +1. The time now is 04:32 PM.

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"