Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I'm new to programming in VBA and I'm using this code to update my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub


I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I figured out the solution to issue 1. , there was a problem with 1
character. Is there a better code solution?

I still haven't found a solution to issue 2 or the beforeprint issue.

Would still love some help.


On Jan 20, 7:11*am, "Breck" wrote:
I'm new to programming in VBA and I'm using this code to update *my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub

I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I figured out the solution to issue 1. , there was a problem with 1
character. Is there a better code solution?

I still haven't found a solution to issue 2 or the beforeprint issue.

Would still love some help.


On Jan 20, 7:11*am, "Breck" wrote:
I'm new to programming in VBA and I'm using this code to update *my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub

I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I figured out the solution to issue 1. , there was a problem with 1
character. Is there a better code solution?

I still haven't found a solution to issue 2 or the beforeprint issue.

Would still love some help.


On Jan 20, 7:11*am, "Breck" wrote:
I'm new to programming in VBA and I'm using this code to update *my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub

I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I figured out the solution to issue 1. , there was a problem with 1
character. Is there a better code solution?

I still haven't found a solution to issue 2 or the beforeprint issue.

Would still love some help.


On Jan 20, 7:11*am, "Breck" wrote:
I'm new to programming in VBA and I'm using this code to update *my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub

I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Updated header information from cell

I figured out the solution to issue 1. , there was a problem with 1
character. Is there a better code solution?

I still haven't found a solution to issue 2 or the beforeprint issue.

Would still love some help.


On Jan 20, 7:11*am, "Breck" wrote:
I'm new to programming in VBA and I'm using this code to update *my sheet
headers automatically

Private Sub worksheet_activate()
ActiveSheet.PageSetup.CenterHeader ="&22 " & Sheet75.Range("B3").Value &
Chr(10) & "&22 " & Range("A1").Value
End Sub

I would like to do modify it to

1. run only if the current CenterHeader has changed or different than the 2
value in the cells that it was created from and
2. get the font size from Sheet75.Range("A3")

I've tried
"If ActiveSheet.PageSetup.CenterHeader < "&22 " &
Sheet75.Range("CenterHeader").Value & Chr(10) & "&22 " & Range("A1").Value
Then"
for the first one but its not working. And because of the quotes on the font
size putting a range between the quotes doesn't seem to work for the second
one either

Is this possible.

I've searched this forum for more that an hour and can't find anything
similar?

I've also tried using the BeforePrint which worked great when printing just
one sheet at a time. But when I group sheets together and print the grouped
sheets all of the additional sheets have been updated to the
Range("A1").Value from the first sheet of the group and not the A1 cell on
its own sheet. I thought that the before print was the better way to go but
was disappointed that I couldn't get it to work when printing groups of
sheets. Also there are some sheets that I don't want the header updated or
changed so putting that code in thisworkbook doesn't seem to be the way to
go.


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
Old address information updated to current addressi Charles Excel Worksheet Functions 1 November 11th 09 03:34 PM
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
How do I display the last updated date in the page header? Aging Hippie Excel Discussion (Misc queries) 2 July 18th 08 09:31 PM
Reacting to updated information tommo Excel Worksheet Functions 2 February 28th 08 12:24 AM
in Excel is it possible to have header information show in a cell BobKoz Excel Discussion (Misc queries) 0 August 15th 07 08:36 PM


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