#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

Can't reproduce this

Which Excel version do you use ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Something strange occurring!
I cannot select multiple sheets - every time I select more than 1 sheet to
print it defaults to the 'active sheet' only. Never experienced this before
so i assume it is something to do with the code - this is the only code I
have in the spreadsheet

Any ideas?

Regards
Saintsman

"Ron de Bruin" wrote:

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Headers

Ron
Excel 2003
Experimented last night on different pc = same result
If I remove the code the print all sheets works
Odd?

"Ron de Bruin" wrote:

Can't reproduce this

Which Excel version do you use ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Something strange occurring!
I cannot select multiple sheets - every time I select more than 1 sheet to
print it defaults to the 'active sheet' only. Never experienced this before
so i assume it is something to do with the code - this is the only code I
have in the spreadsheet

Any ideas?

Regards
Saintsman

"Ron de Bruin" wrote:

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

Hi Saintsman

Test it in 2003 without a problem

Send me the test file private and I test it on my system



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Excel 2003
Experimented last night on different pc = same result
If I remove the code the print all sheets works
Odd?

"Ron de Bruin" wrote:

Can't reproduce this

Which Excel version do you use ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Something strange occurring!
I cannot select multiple sheets - every time I select more than 1 sheet to
print it defaults to the 'active sheet' only. Never experienced this before
so i assume it is something to do with the code - this is the only code I
have in the spreadsheet

Any ideas?

Regards
Saintsman

"Ron de Bruin" wrote:

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

You are welcome

Thanks for the feedback


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Managed to fix it (looks like the spreadsheet was corrupt somwhere) I
recreated it & everything is fine
Thanks very much for your help!

David

"Ron de Bruin" wrote:

Hi Saintsman

Test it in 2003 without a problem

Send me the test file private and I test it on my system



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Excel 2003
Experimented last night on different pc = same result
If I remove the code the print all sheets works
Odd?

"Ron de Bruin" wrote:

Can't reproduce this

Which Excel version do you use ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Something strange occurring!
I cannot select multiple sheets - every time I select more than 1 sheet to
print it defaults to the 'active sheet' only. Never experienced this before
so i assume it is something to do with the code - this is the only code I
have in the spreadsheet

Any ideas?

Regards
Saintsman

"Ron de Bruin" wrote:

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Headers

Hi Saintsman

I see the problem also.
I test more this weekend and send a bug report

Thanks


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Back again!
Found the problem
There is an issue when you use the 'rows to repeat at the top'

I set this up on one worksheet, select multiple sheets (2 is enough) & print
preview

1 - if I include the sheet with rows to repeat active it works
2 - select 2 other sheets & it doesn't work

Hope this makes sense

David

"Ron de Bruin" wrote:

You are welcome

Thanks for the feedback


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Managed to fix it (looks like the spreadsheet was corrupt somwhere) I
recreated it & everything is fine
Thanks very much for your help!

David

"Ron de Bruin" wrote:

Hi Saintsman

Test it in 2003 without a problem

Send me the test file private and I test it on my system



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message ...
Ron
Excel 2003
Experimented last night on different pc = same result
If I remove the code the print all sheets works
Odd?

"Ron de Bruin" wrote:

Can't reproduce this

Which Excel version do you use ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Ron
Something strange occurring!
I cannot select multiple sheets - every time I select more than 1 sheet to
print it defaults to the 'active sheet' only. Never experienced this before
so i assume it is something to do with the code - this is the only code I
have in the spreadsheet

Any ideas?

Regards
Saintsman

"Ron de Bruin" wrote:

Sorry, use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & Chr(10) & _
Sheets("sheet1").Range("A2").Value & Chr(10) & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Stupendously quick reply - thanks!
Minor problem - it gives blank rows between each row - any thoughts?

Saintsman

"Ron de Bruin" wrote:

Hi Saintsman

You can use cell values in your header if you want
Try this event in the thisworkbook module (untested)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = _
Sheets("sheet1").Range("A1").Value & vbNewLine & _
Sheets("sheet1").Range("A2").Value & vbNewLine & _
Sheets("sheet1").Range("A3").Value
Next wkSht
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Saintsman" wrote in message
...
Being a bit dim after Xmas I'm afraid & cannot see how to do this

I want to allow the user to set header in a workbook - all will be the same
(apart from a front cover)
My plan was to have a worksheet where the user can enter the details, which
will vary, and these would then set the workbook headers

ie (on 3 rows in the header)
cell A1 = Project X
cell A2 = Revision 6
cell A3 = date

Anyone out there who can fix this for me please.

Thanks in anticipation










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
lookup using column headers and row headers Memphus01 Excel Discussion (Misc queries) 1 April 13th 09 04:57 PM
Headers Holden Caulfield Excel Discussion (Misc queries) 1 April 26th 06 09:59 PM
Help with Headers jessica Excel Discussion (Misc queries) 0 April 6th 05 06:41 PM
Row Headers the_divine_blade Excel Discussion (Misc queries) 4 January 23rd 05 09:31 PM
SQL with no headers Seth[_3_] Excel Programming 1 July 9th 03 07:52 AM


All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"