+ Reply to Thread
Results 1 to 14 of 14

Use Checkbox Userform to select worksheets and save to PDF

  1. #1
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    5

    Cool Use Checkbox Userform to select worksheets and save to PDF

    Hi,

    I am brand new to the forum and vba, so be nice

    I have already created a Userform to select worksheets to print but what i'm struggling with is to create a userform to select what ever worksheets are required and save as PDF (multiple or as one-doesn't particularly matter).

    Saved PDF file to be saved within the same folder as the excel file, with same name but "todays" date.

    Don't want to be cheeky, but as a bonus, would it be possible to add an option that once saved you can choose whether to print the saved pdf? (not essential as i have the userform to print).

    I have spent days looking online but nothing seems to quite work. Ive seen a couple of threads on here, but they don't seem to deal with it/or my knowledge isn't great enough to amend to suit...probably the latter! I got close, but it would only save the first sheet selected in the checkbox.

    Thanks in advance for your help.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Hi alistairmcquat

    Welcome to the Forum!!!

    In order for us to assist, please attach a sample workbook the Structure of which is the same as your actual workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    INCLUDE ANY CODE YOU'RE USING OR HAVE TRIED.

    Remember to desensitize the data.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 05-20-2017 at 07:18 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

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

    Re: Use Checkbox Userform to select worksheets and save to PDF

    @ mehmetcik

    Just some info

    Please Login or Register  to view this content.
    This isn't really needed because when exporting the extension is automatically added.
    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.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Thanks

    Never tried exporting before.

  6. #6
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    5

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Hi thanks for the replies.
    As i mentioned im pretty new (brand new) to vba. Tried the listbox above, but how do you get certain worksheets to save as pdf?

    going back to my original post/query, below is the code ive got to print multiple selected sheets, is there a way to tweek this to suit? Ive tried to upload the file, but the attachment button doesnt seem to want to work for me right now.
    Its a simple excel workbook with 20 worksheets (this will increase). I have a main worksheet where all the infomation is inputted and cascaded through teh other sheets. I then need a "PDF" button that pops up a list of all the worksheets, so you can select which ones you require and then save as pdf.

    Ill try and upload the file late.

    Please Login or Register  to view this content.
    This is the above code i tried to tweek to save as pdf, but it only manages one sheet then complains.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Ok

    I have attached a few sample Userforms for you.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    5

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Thank you, ill have a wee look at them today and get back to you.

  9. #9
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    5

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Thanks for all the help, but its clear my knowledge is sooo green that none of the help is making any serious sense....i also still cant upload the file

  10. #10
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    5

    Re: Use Checkbox Userform to select worksheets and save to PDF

    ok, i think im getting there.

    I am struggling with this bit of code though, keeps popping up with a "424" error, object required when i press the command button. What am i missing?

    Please Login or Register  to view this content.

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

    Re: Use Checkbox Userform to select worksheets and save to PDF

    To upload workbook check this out.
    Post#1 - method2.
    https://www.excelforum.com/the-water...his-forum.html

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Try this version.

    I have modified it to avoid that line of code.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    01-08-2018
    Location
    IRELAND
    MS-Off Ver
    2010
    Posts
    2

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Mehmetcik

    Your sample above is exactly what i am looking for, to be able to select which worksheets I want to PDF,
    However I have one request, on sheet 1 I have a quote generator which works quite nicely, however depending on the type of customer I have different terms and conditions and customer requirements on worksheet 2 to 5
    What i would love to do is when I hit your Button 1 "export as PDF" that it prints worksheet 1 and the corresponding selected worksheets into one nice PDF, rather than multiple ones,

    Thanks for the help

    Frank

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

    Re: Use Checkbox Userform to select worksheets and save to PDF

    Hi Frank, welcome to the forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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. Use a Check box userform to select worksheets and Save As one PDF
    By Nik21 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-28-2019, 05:34 PM
  2. Select All Checkboxes Checkbox That Also Calls Checkbox Macros
    By Intervigilium in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2015, 06:41 PM
  3. [SOLVED] Select checkboxes on a userform to save to PDF and e-mail
    By Kolein in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-22-2014, 10:45 AM
  4. How to use checkbox to select which worksheets will be saved to CSV format
    By hungryheart08 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2013, 11:59 PM
  5. [SOLVED] Debug Print select worksheets userform
    By cammyjane10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2013, 01:59 PM
  6. Userform vlookup with the ability to save or select values
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-06-2009, 12:16 PM
  7. filter data on all worksheets using checkbox on userform
    By macximus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2008, 03:33 AM

Tags for this Thread

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