Solved

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

Posted on 2014-10-08
1
102 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

688 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