alu
06-18-2007, 07:16 AM
Hi,
I have a workbook that contains several worksheets with data in columns A-N.
The amount of rows varies from sheet to sheet. but up to 100 rows.
I have a custom header that uses A1-N1 on each sheet ("Top Ten = Worksheet name). But if the worksheet has 4 pages my header only appears on the first page.
I would it to appear on all sheets. This is the code I have but I cant work out how to adapt it without producing absolutly tons of VBA using the recorder?!! Thanks all
'Insert Header
Sheets(Array("State 1", "State 2", "State 3", "State 4", _
"State 5", "State 6l")).Select
Sheets("Solutions").Activate
Range("A1").Select
Workbooks.Open FileName:= _
"D:\My Documents\Top States\Header template.xls"
Sheets("Header").Select
Rows("1:1").Select
Selection.Copy
Windows("top ten.xls").Activate
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
Sheets("Solutions").Select
I have a workbook that contains several worksheets with data in columns A-N.
The amount of rows varies from sheet to sheet. but up to 100 rows.
I have a custom header that uses A1-N1 on each sheet ("Top Ten = Worksheet name). But if the worksheet has 4 pages my header only appears on the first page.
I would it to appear on all sheets. This is the code I have but I cant work out how to adapt it without producing absolutly tons of VBA using the recorder?!! Thanks all
'Insert Header
Sheets(Array("State 1", "State 2", "State 3", "State 4", _
"State 5", "State 6l")).Select
Sheets("Solutions").Activate
Range("A1").Select
Workbooks.Open FileName:= _
"D:\My Documents\Top States\Header template.xls"
Sheets("Header").Select
Rows("1:1").Select
Selection.Copy
Windows("top ten.xls").Activate
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
Sheets("Solutions").Select