+ Reply to Thread
Results 1 to 4 of 4

Increase cell by 1, print as PDF and save PDF with that cell number as file name

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Increase cell by 1, print as PDF and save PDF with that cell number as file name

    Hello,

    I am making a PDF page-per-day diary and it is my first foray into macros. Rather than sitting here re-typing the date 364 times I am hoping someone can help me

    I would like a button or a shortcut that increases the cell number (cell is D4) by 1, then print as a PDF, then save as a PDF with the value of D4 as the filename.

    Is this possible?

    Thank you

    Anna

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Increase cell by 1, print as PDF and save PDF with that cell number as file name

    If you have a PDF printer installed, something like:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Increase cell by 1, print as PDF and save PDF with that cell number as file name

    Thank you!

    That works great for updating the date and printing as PDF.

    Is there any way to make it save the PDF by the value in D4 or do I have to do that manually?

    Thanks again

    Anna

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Increase cell by 1, print as PDF and save PDF with that cell number as file name

    Hi Anna

    you need to use Save As ... PDF file

    the code is:

    Please Login or Register  to view this content.

    You'd need to change the file name to include the date. However, you'll need to format the date so that it doesn't have the slashes in it.

    So you'd use the value in D4 but you'd format it (maybe using TEXT) as "ddmmyyyy"

    Please Login or Register  to view this content.

    So, you just have to hang those bits of code together ...


    Regards, TMS

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1