PDA

View Full Version : [SOLVED] Header



austenr
05-25-2005, 07:45 AM
I am trying to use a range of cells to use in the header on Sheet2. However, using the code below I only cet cell C1. Does anyone know why or is there a way to use a range of cells in a header?


Worksheets("Sheet2").PageSetup.LeftHeader = _
Worksheets("Sheet1").Range("C1:E1")

Norie
05-25-2005, 07:50 AM
I think you'll need to loop through the cells and add their contents to the header.




Dim c As Range

For Each c in Worksheets("Sheet1").Range("C1:E1")
Worksheets("Sheet2").PageSetup.LeftHeader = Worksheets("Sheet2").PageSetup.LeftHeader & c.Value
Next c

austenr
05-25-2005, 07:55 AM
Thanks that got it!! Solved