Solved

How to write VBA code to add date into a PDF file footer

Posted on 2014-10-08
1
98 Views
Last Modified: 2014-10-09
I created a button to let users to save the Excel workbook to a PDF file.  Now the users asked to add the version number of the workbook and the saving date into the PDF file.  Can you help me on this?
0
Comment
Question by:jjxia2001
1 Comment
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40369474
This excerpt of code could be added before the print method to add a date on the left footer and  version number on the right footer.
    'add to definitions
    Dim strVersion As String

    'Assign version number in code
    strVersion = "1.0.A"
    
    'Insert before Print method
    With ActiveSheet.PageSetup
        .LeftFooter = "&D"
        .CenterFooter = ""
        .RightFooter = "&F - Version " & strVersion
    End With

Open in new window


You'll need to assign the version number in your existing code, this is just an example.

Regards,
-Glenn
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question