Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Footers

Status
Not open for further replies.

UnsolvedCoding

Technical User
Jul 20, 2011
424
US
Are there any known coding reasons why a footer in Excel would not update properly for printing?

The code for the footers is created in a separate macro, and the workbook can be closed and re-opened and the footers will show up on print preview and print correctly for the first few. Up to ten at a time have been checked for accuracy. But when I try to print a set of 50 or more sheets the footer isn't updating, it simply retains the information from the first page.

Is this a coding issue, a printer issue or a formatting issue?

And yes, I know the workbook is large, can't get around that.

It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
HI,

You shouldn't have posted this issue in two forums.

You failed to mention, "The code for the footers..."

...and the code is????

Do you think that that might be relevant?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
The other forum post was aimed at possible worksheet issues targeting printing, this post was aimed at more behind the scenes things that would be more coding oriented.



It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
Code:
Private Sub CB_Formatting()

On Error GoTo Error_Handler

100:    Application.StatusBar = "Running Panel_Master. Sub CB_Formatting"

        ' Footer for worksheet. Must Remain intact.
200:    With Sheets(CB_PANEL_NAME).PageSetup
300:        .LeftFooter = _
                "&16Model:  " & CB_PANEL_NAME & Chr(10) & "DWG #:  " & JOB_NUMBER & "-" & _
                TEMP_NMBR & Chr(10) & "ENVIRONMENTAL: TYPE 1" & Chr(10) & _
                "COMM POWER REQ:  1.0 A" & Chr(10) & "DEVICE POWER REQ: " & CB_AMPS _
                & ".0 A" & Chr(10) & "SHORT CIRCUIT RATING:  5 kA" & Chr(10) & _
                "DATE BUILT: _______________" & Chr(10) & "BY_________INSP___________"
400:        .CenterFooter = "&12UL INDENTIFICATION # E233328&10" & Chr(10) _
                & "" & Chr(10) & "&G"
500:        .LeftMargin = Application.InchesToPoints(0.25)
600:        .RightMargin = Application.InchesToPoints(0.25)
700:        .TopMargin = Application.InchesToPoints(0.25)
800:        .BottomMargin = Application.InchesToPoints(0.5)
900:        .HeaderMargin = Application.InchesToPoints(0.5)
1000:       .FooterMargin = Application.InchesToPoints(0.1)
1100:       .CenterHorizontally = True
1200:       .FitToPagesWide = 1
1300:       .FitToPagesTall = 1
1400:   End With
    
1500:   Exit Sub

Error_Handler:

Application.ScreenUpdating = True
FLAG = False: FINISH = Timer
TEST = MsgBox("CB_Formatting Malfunctioned." & vbCrLf & _
        "Error Number - " & Err.Number & vbCrLf & "Error Source - " & Err.Source & _
        vbCrLf & "Error Description - " & Err.Description & _
        vbCrLf & "Error Line: " & Erl & vbCrLf & "Help File - " & Err.HelpFile & _
        vbCrLf & "Context - " & Err.HelpContext, vbOKOnly + vbCritical)
        
End Sub

It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
I assume that you solved your problem based on your comments in you thread in forum68.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I don't know the problem has been solved long term, however I was able to get the pages to print with the footers showing properly. If possible, I would like to find or write code that will stop this from happening again.

It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
Your code assigns footers for one sheet.

What about all the other sheets?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
You are correct.

The footer is created for each sheet because it holds specific information for that sheet.

CB_PANEL_NAME references which two sheets the footer is identifying

JOB_NUMBER is the number the shop and engineers use

TEMP_NMBR holds the specific info for the job number and CB_PANEL_NAME, as well as references what other departments require.

The rest of the information has to do with electrical components and measurements which is also specific to the individual worksheet.

It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
Have you tried to run your code without error handling (can be done without touching the code, in VBE genetal options, error trapping, set "break on all errors" option)..

combo
 
Found this link


Haven't yet been able to test and see if that solves the problem.

It has taken me a while to make sense of what I hear at work involving computers. There is much talk of bugs and questions about Raid.
Therefore I have come to the logical conclusion that the only way to have a properly functioning computer is to regularly spray it with Raid bug killer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top