+ Reply to Thread
Results 1 to 4 of 4

Save selected print area as a pdf file using the text from a specific cells as the file na

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Save selected print area as a pdf file using the text from a specific cells as the file na

    Hi,

    I use Excel 2010 on Windows 10

    I have a sheet that I use for invoices.
    I can print the selected print area directly to a pdf using windows 10 via printer dialogue, and then manually type in a location and file name.

    I would like to have a macro to print the print area to the pdf file and pick the Invoice number from L6, the customer name from E13 and the date from L7 and combine this into one cell so I can copy and paste it to the file name for the pdf? ...or better still populate the file name and save the file to a specified folder.

    Any help of suggestion would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Save selected print area as a pdf file using the text from a specific cells as the fil

    Hi,
    This is quite simple.
    I've written the macro, included a PgSteup to scale all columns to one page wide and it saves it as a pdf.

    The variables mypath are the current workbook location, you can change that and the filename is like you sad, maybe some formatting but that shouldn't be a problem.

    It's just the Save As PDF which is standard in Excel

    PS: Sorry hadn't seen it was marked SOLVED, well, anyway
    Attached Files Attached Files
    Last edited by Keebellah; 10-16-2015 at 05:01 PM. Reason: Extra
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Save selected print area as a pdf file using the text from a specific cells as the fil

    Hi,
    I have decided to use your macros, thank you.
    Can you tell me how I can change the location the file is saved to please?
    There is also a problem with the footer, it only displays " 1 of " when it should be " 1 of 2 "
    Really appreciate your help.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Save selected print area as a pdf file using the text from a specific cells as the fil

    The page numbers in the footer seems to be a know issue
    I just pasted the code for a folder selector in it, got it straight from Google
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Export Cells to Text and automatically have File Name and File Type Selected
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-18-2014, 03:37 PM
  2. [SOLVED] Macro to create text file and write contents of selected cells to the file
    By m@cro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2013, 10:21 AM
  3. Replies: 0
    Last Post: 01-13-2013, 02:44 PM
  4. Save only selected cells as a CSV file
    By aharvestofhealth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2010, 05:01 PM
  5. code to save selected(pre defined)text to text file
    By martindwilson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-27-2008, 06:51 PM
  6. [SOLVED] How Do I Save a Selected/Highlighted Area to Another File?
    By jim evans in forum Excel General
    Replies: 2
    Last Post: 06-16-2006, 09:25 AM
  7. [SOLVED] Print Area:a user to navigate to a text file
    By MarkN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2006, 09:45 PM

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