+ Reply to Thread
Results 1 to 4 of 4

Skip a range while saving excel data as PDF

  1. #1
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Skip a range while saving excel data as PDF

    Hello,

    I've written a macro to save excel data as a PDF.
    However, there are a couple of things which I'm not able to achieve.

    Please Login or Register  to view this content.
    1. How to save the file each time automatically with a different name? For e.g., it should be stored as 'Report_101_19Jul16', 'Report_102_19Jul16', and so on?
    2. How to skip a particular range while creating the PDF out of the data? For e.g., it should create pdf of the data - "A1:C107 & H1:I107". Column D,E,F,G should be skipped out.
    3. How to fit that content in a single page in the PDF generated? For e.g., currently, it is displaying column A, B in one page, others in a seperate page. How do I ensure all the desired content fits in one page?

    Regards,
    Anshul
    Last edited by anshul1719; 07-19-2016 at 03:29 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Skip a range while saving excel data as PDF

    This uses cell Z1 as a report number counter. Put 101 in Z11 and it willl be used in the file name and increased by 1 each time the macro is run. The macro generates a file name based on the Z1 number and the Date

    Columns D:G are hidden before the sheet is saved as PDF and unhidden after the save.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Re: Skip a range while saving excel data as PDF

    Thanks a lot, that works!

    But how about saving the entire data in a single page of a PDF instead?
    Any idea on how could I achieve that?

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Skip a range while saving excel data as PDF

    Maybe try decreasing the font size on the sheet.

+ 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. Skip Weekend Day while saving
    By martinez_pedro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2016, 08:41 PM
  2. [SOLVED] How to skip Sundays while adding data in an Excel sheet
    By vsravi.kmb in forum Excel General
    Replies: 7
    Last Post: 09-25-2015, 12:32 PM
  3. Saving a selected range of an excel sheet as PDF
    By karimretina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2014, 03:42 AM
  4. Skip a step in the Macro if a range has no data
    By 1-Ton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2013, 02:43 PM
  5. [SOLVED] Saving files as tomorrow's date with VBA; how do I skip weekends?
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2013, 02:23 PM
  6. [SOLVED] Saving range of cells in a PDF format using a button on excel worksheet
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2013, 12:18 PM
  7. Replies: 1
    Last Post: 11-08-2010, 02:15 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