VB Easy Question
Posted by RoB on August 16, 2001 10:48 AM
Ok, forgive me, I'm still learning. I found this custom header code on the board. What I want to do is specify a cell on a certain sheet as the header for ALL the sheets. I have the code, but have a question. I know that I need to define the Range, but how do I define a range and worksheet?
Would it be:
WorkSheet("Sheet 1").Range("A1") ??
This is the Code for reference:
Sub Cust_Header()
'Written by Barrie Davidson
Dim xls As Worksheet
For Each xls In ActiveWorkbook.Worksheets
wks.Activate
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = Worksheet("Sheet 1").Range("A1").Value
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
End With
Next xls
End Sub