Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: London
Posts: 2
Default CellinFooter() Specify Which Sheets are updated

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

As you can see the code below updates the right headers for all sheets in my workbook with the value in sheet = VBlookup, Cell B1. I have several sheets in the work book that I don't want updated. Is it 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 Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default CellinFooter() Specify Which Sheets are updated

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
wrote:


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

As you can see the code below updates the right headers for all sheets
in my workbook with the value in sheet = VBlookup, Cell B1. I have
several sheets in the work book that I don't want updated. Is it
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 Sub


  #3   Report Post  
Junior Member
 
Location: London
Posts: 2
Default

Worked a treat, thanks Gord.

Quote:
Originally Posted by Gord Dibben View Post
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
wrote:


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

As you can see the code below updates the right headers for all sheets
in my workbook with the value in sheet = VBlookup, Cell B1. I have
several sheets in the work book that I don't want updated. Is it
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 Sub
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default CellinFooter() Specify Which Sheets are updated

Thanks for the feedback.

Gord

On Wed, 26 May 2010 10:48:33 +0100, Microuch
wrote:


Worked a treat, thanks Gord.

Gord Dibben;956056 Wrote:
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
wrote:
-

I have spent much of the morning looking at various forums & threads

but
had no luck finding exactly what I need.

As you can see the code below updates the right headers for all

sheets
in my workbook with the value in sheet = VBlookup, Cell B1. I have
several sheets in the work book that I don't want updated. Is it
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 Sub-


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
Excel cells randomly don't get updated unless each cell is updated Lost in Excel Excel Discussion (Misc queries) 5 September 29th 08 06:56 PM
date last updated hoyt New Users to Excel 1 December 19th 06 02:21 PM
How to compare new/updated/withdrawn records between two sheets Tayto Excel Discussion (Misc queries) 0 August 12th 06 09:04 AM
updated row comes at the top Fam via OfficeKB.com Excel Discussion (Misc queries) 2 April 11th 06 05:20 AM
Keeping data updated between 2 sheets... novice needs help. FatMagic Excel Discussion (Misc queries) 5 October 14th 05 09:38 PM


All times are GMT +1. The time now is 06:47 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"