Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't get this code to work proper in the event. When I run the code by
itself, it works no problem, but when it is in the event, it runs through the code but does not update the footer, the code is in 'ThisWorkbook': Sub Workbook_Beforeprint(Cancel As Boolean) Dim foot As String foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " & Format(Now, "H:MM am/pm") Worksheets("Report").PageSetup.RightFooter = foot End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Runs fine here. Be sure events are enabled.
-- Jim "Dave M" wrote in message ... |I can't get this code to work proper in the event. When I run the code by | itself, it works no problem, but when it is in the event, it runs through the | code but does not update the footer, the code is in 'ThisWorkbook': | | Sub Workbook_Beforeprint(Cancel As Boolean) | Dim foot As String | foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " & | Format(Now, "H:MM am/pm") | Worksheets("Report").PageSetup.RightFooter = foot | | End Sub | |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I hit 'F8' to run through the code, it looks like it runs proper, but
the footer is not updated! "Jim Rech" wrote: Runs fine here. Be sure events are enabled. -- Jim "Dave M" wrote in message ... |I can't get this code to work proper in the event. When I run the code by | itself, it works no problem, but when it is in the event, it runs through the | code but does not update the footer, the code is in 'ThisWorkbook': | | Sub Workbook_Beforeprint(Cancel As Boolean) | Dim foot As String | foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " & | Format(Now, "H:MM am/pm") | Worksheets("Report").PageSetup.RightFooter = foot | | End Sub | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, it updates here so the code is okay. I don't know why it doesn't
result in a changed footer for you. -- Jim "Dave M" wrote in message ... | When I hit 'F8' to run through the code, it looks like it runs proper, but | the footer is not updated! | | "Jim Rech" wrote: | | Runs fine here. Be sure events are enabled. | | -- | Jim | "Dave M" wrote in message | ... | |I can't get this code to work proper in the event. When I run the code by | | itself, it works no problem, but when it is in the event, it runs through | the | | code but does not update the footer, the code is in 'ThisWorkbook': | | | | Sub Workbook_Beforeprint(Cancel As Boolean) | | Dim foot As String | | foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " & | | Format(Now, "H:MM am/pm") | | Worksheets("Report").PageSetup.RightFooter = foot | | | | End Sub | | | | | |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There was another thread (within the last month???) where different user had the
same problem. The code would always work for me. His solution was to add a button that would fix the header and print the job. Dave M wrote: When I hit 'F8' to run through the code, it looks like it runs proper, but the footer is not updated! "Jim Rech" wrote: Runs fine here. Be sure events are enabled. -- Jim "Dave M" wrote in message ... |I can't get this code to work proper in the event. When I run the code by | itself, it works no problem, but when it is in the event, it runs through the | code but does not update the footer, the code is in 'ThisWorkbook': | | Sub Workbook_Beforeprint(Cancel As Boolean) | Dim foot As String | foot = "Report Printed on " & Format(Now, "DD MMMM YYYY") & " at " & | Format(Now, "H:MM am/pm") | Worksheets("Report").PageSetup.RightFooter = foot | | End Sub | -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I put this in a workbook. After I changed the sheet name to Report, it
printed "Report Printed on 18 April at 9:30 am" in the lower right hand corner of the page. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print a range when an event happens | Excel Discussion (Misc queries) | |||
Syntax of If statement in before print event | Excel Programming | |||
After Print event | Excel Programming | |||
print event | Excel Programming | |||
before print event not working | Excel Programming |