CellinFooter() Specify Which Sheets are updated

M

Microuch

I have spent much of the morning looking at various forums & threads bu
had no luck finding exactly what I need.

As you can see the code below updates the right headers for all sheet
in my workbook with the value in sheet = VBlookup, Cell B1. I hav
several sheets in the work book that I don't want updated. Is i
possible to specify which sheets the code update?

Thanks in advance

Sub CellInFooter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.PageSetup.RightHeader = Range("VBlookup!B1").Text
Next ws
End Su
 
G

Gord Dibben

Sub CellInFooter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets _
(Array("Sheet1", "Sheet3", "Sheet5"))
ws.PageSetup.RightHeader = Range("VBlookup!B1").Text
Next ws
End Sub


Gord Dibben MS Excel MVP
 
M

Microuch

Worked a treat, thanks Gord.
Sub CellInFooter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets _
(Array("Sheet1", "Sheet3", "Sheet5"))
ws.PageSetup.RightHeader = Range("VBlookup!B1").Text
Next ws
End Sub


Gord Dibben MS Excel MVP


On Tue, 25 May 2010 14:26:09 +0100, Microuch
 

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

Top