Macro to Select All Sheets and Make Change to Footer

  • Thread starter Thread starter Karin
  • Start date Start date
K

Karin

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
 
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
 
It seems to go to next sheet and on from there without changing the sheet you
are on or the sheets before it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top