+ Reply to Thread
Results 1 to 6 of 6

Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

  1. #1
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    76

    Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    Calling for a REAL VBA Expert. The code below works PERFECTLY when saving as a CSV.
    *I'm hoping some one can modify this code to remove CSV references and save as a PDF. The file path and naming works.
    I am a Nubie, and have tried many hours to modify this code to save as a PDF. There may be other code available, but this one works. HELP! If nothing else...help get me close.

    Steve

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,694

    Re: Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    76

    Re: Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    Greg M - I LOVE your Country!!!! Been to Dublin a couple times. Last time there I was made to dance the Irish Jig at the Jameson Distillery :-( Wasn't Pretty!

    You GOT me very close!!!! I need the PDF Output to only include whats in the Print Area. is that possible?

    Steve

  4. #4
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    76

    Re: Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    BTW - I did a little searching...I tried the following...but did not resolve printing to only print area.

    Please Login or Register  to view this content.
    If I go to tab and try to print it, It does print to Print Area Only. There are cells to right of doc that should not be included in PDF output.

    Greg - you got me very close...hope you can figure out the issue for me!

    Steve

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,694

    Re: Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    Hi again,


    Last time there I was made to dance the Irish Jig at the Jameson Distillery :-( Wasn't Pretty!

    yes, I think I read about that in the national newspapers!


    Your original code used:
    Please Login or Register  to view this content.
    so thats why I used "With ActiveSheet.UsedRange"


    To restrict the PDF output to the PrintArea of the worksheet, just use:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

  6. #6
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    76

    Re: Calling for a VBA Expert! This code works for CSV....Need same to save to PDF.

    Greg - Your great!!!!!!! It worked perfectly. I "was" going to close this thread...but was told we also need to be able to save as an xlsx file as well. Can you privide what I should change in above code to save as a xlsx doc (Print Area only)?

    Steve

+ 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. Macro save row as text, works on specific folder only need to work globally, code enclosed
    By Dale Saukerson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2020, 04:30 PM
  2. Code for "SAVE-AS" works good but not perfect
    By mbdigital in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2014, 05:36 PM
  3. how can i make this code works for multiple links it only works for one link
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2014, 08:38 AM
  4. Excel 2010 file with VBA save and send code works-but file can't be found.
    By carlton.clay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2013, 09:46 AM
  5. Replies: 10
    Last Post: 04-18-2012, 10:33 AM
  6. [SOLVED] Any way to save VBA code so it works with older Excel revisions?
    By fugazi48 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2006, 09:10 AM

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