+ Reply to Thread
Results 1 to 7 of 7

Macro to create 2 separate PDF files of 2 sheets - saved in same location

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    London England
    MS-Off Ver
    Office 365
    Posts
    69

    Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Hi

    I have a quote tool that I need to create a macro that when the users push the button "complete" it will automatically complete the following;


    Save the excel file as "Sheet1!A1 Sheet1!A2 " in location C:\Users\Matt\Desktop\Matts quotes

    Then create PDF copys of;

    sheet name = systemdesign
    save as =Sheet1!A1 Sheet1!A2/systemdesign
    File type = PDF
    File location = C:\Users\Matt\Desktop\Matts quotes

    sheet name = kitlist
    save as =Sheet1!A1 Sheet1!A2/kitlist
    File type = PDF
    File location = C:\Users\Matt\Desktop\Matts quotes

    Then open both pdfs on completion.

    Many thanks for your help

    Matt

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    How about this ?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Hi Matt,

    I created a similar "tool" recently for Quotes/Orders.
    My concern with your request is that if the Quote(s) and the PDF(s) are saved using exactly the same reference it will "replace" the previous one that was saved.
    You will have to include a Customer Name and Quote No. in the reference so that each "save" is different.

    Regards

    peterrc

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Matt , I spotted that your requested file name includes a "forward slash"
    This list may be useful:

    Characters not allowed in file and folder names:
    < (less than)
    > (greater than)
    : (colon)
    " (double quote)
    / (forward slash)
    \ (backslash)
    | (vertical bar or pipe)
    ? (question mark)
    * (asterisk)
    Last edited by kev_; 09-16-2017 at 01:54 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Registered User
    Join Date
    01-07-2014
    Location
    London England
    MS-Off Ver
    Office 365
    Posts
    69

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Thank you Bakerman2, very helpful. Could you please let me know what needs to change to prevent the PDF's opening? Also, the excel file saves in a different format, is that correct?

    Many thanks

  6. #6
    Registered User
    Join Date
    01-07-2014
    Location
    London England
    MS-Off Ver
    Office 365
    Posts
    69

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Thank you Kev

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Macro to create 2 separate PDF files of 2 sheets - saved in same location

    Remove everything after systemdesidn and kitlist (all comma's and the True)
    About the format since you are working with XL2003 I thought xls would be appropriate.

    Please Login or Register  to view this content.
    BTW Thanks for rep+.
    Last edited by bakerman2; 09-17-2017 at 06:58 PM.

+ 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. Replies: 1
    Last Post: 09-01-2016, 01:40 PM
  2. Macro Multiple excel files into one workbook as separate sheets
    By ian_a91 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2014, 08:54 AM
  3. [SOLVED] Specify export pdf file location is location workbook is saved.
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2014, 01:13 PM
  4. Replies: 2
    Last Post: 09-19-2013, 04:22 AM
  5. [SOLVED] VBA / Macro help needed to create separate sheets from Master sheet by year
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2013, 08:34 AM
  6. Macro to create separate sheets
    By scauley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2010, 06:07 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