?
Solved

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

Posted on 2014-10-08
1
Medium Priority
?
103 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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