+ Reply to Thread
Results 1 to 12 of 12

How to call all my already created macros with one button, print one report [easy]

  1. #1
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    How to call all my already created macros with one button, print one report [easy]

    Hey guys,

    I have 7 macros right now that dynamically print a pdf of my 7 different tabs, each different and codes working. The are titled the following
    PrintPDF1()
    PrintPDF2()
    PrintPDF3()
    PrintPDF4()
    PrintPDF5()
    PrintPDF6()
    PrintPDF7()

    I want to be able to create a master report with all of these PDF reports in one. I do not know coding enough to do this but I am sure it is simple. I can certainly figure out how to create a macro that calls all these procedures, but they will all save different files. How can I get it to save all these reports in one PDF as one master report? Anything will help

    I have sensitive data so cannot upload the sheet, but if need be I can create a sample with fake data but this will take time, would only do this upon request
    Attached Files Attached Files
    Last edited by lougs7; 07-20-2017 at 03:22 PM.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to call all my already created macros with one button, print one report [easy]

    would only do this upon request
    ... while it is not a difficult request, it still means someone probably has to take a little time to mock up data to test whatever they may suggest - so whose time do you want to save? Yours, or the freebie time 'donated' by someone else??

  3. #3
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    Quote Originally Posted by cytop View Post
    ... while it is not a difficult request, it still means someone probably has to take a little time to mock up data to test whatever they may suggest - so whose time do you want to save? Yours, or the freebie time 'donated' by someone else??
    Thought it was a simple one liner code and a samplebook wasn't needed. I will create a sample certainly, please know that those were not my intendtions. I am very much not like that

  4. #4
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    in fact it is too late too add an attachment and I can't even delete this and start over damn

  5. #5
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: How to call all my already created macros with one button, print one report [easy]

    It's not too late, the add attachment feature just isn't working. Edit your post/reply, and to go to Go Advanced > Managed Attachments to upload.

  6. #6
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    Quote Originally Posted by danielexcelvba View Post
    It's not too late, the add attachment feature just isn't working. Edit your post/reply, and to go to Go Advanced > Managed Attachments to upload.
    I uploaded the attachement :D thanks for your help....!

  7. #7
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    Quote Originally Posted by lougs7 View Post
    Thought it was a simple one liner code and a samplebook wasn't needed. I will create a sample certainly, please know that those were not my intendtions. I am very much not like that
    Didn't mean to sound sassy, but I uploaded the sample book I am dealing with with fake info. Really don't know how to combine all those print codes into one

  8. #8
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to call all my already created macros with one button, print one report [easy]

    didn't mean to sound sassy
    It did.

    To say "...will take time, would only do this upon request" simply says your time is more important than that of anyone who might try to help. It probably ranks right up there with posts asking for help but start with "My requirements..." (Read as:I haven't bothered, you can do it...)

    After saying that, it was necessary to see your code because of the myriad of properties you set before exporting. Rather than try to understand everything going on, I edited a couple of procedures (to test) by adding an optional parameter set to True by default.

    This was done so there would be no effect on your existing calls to those procedures. The procedures are below (Note: all of the lines to set the properties have been removed to aid reading)
    Please Login or Register  to view this content.
    The major difference is the IF block near the end. If the procedure is called from the 'combined' procedure that will be set False. Defaulting to True means none of your existing code to call that procedure need change.

    Another changed proc
    Please Login or Register  to view this content.
    And finally a procedure to call each procedure (to set the page properties), select the sheets you want to merge and create the PDF

    Please Login or Register  to view this content.
    You need to edit your existing procedures as above and you also need to make sure the correct sheet is active or edit the procedure to refer to the correct sheet when setting the properties...

    Thought it was a simple one liner code and a samplebook wasn't needed...
    Simple enough but workbook was essential.

    I also notice you have requested this thread be deleted...
    Last edited by cytop; 07-20-2017 at 04:11 PM.

  9. #9
    Valued Forum Contributor
    Join Date
    07-10-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    430

    Re: How to call all my already created macros with one button, print one report [easy]

    Feel free to correct me if I'm wrong OP, but I'm guessing OP requested that before he figured out how to attach a file

  10. #10
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    Quote Originally Posted by cytop View Post
    It did.

    To say "...will take time, would only do this upon request" simply says your time is more important than that of anyone who might try to help. It probably ranks right up there with posts asking for help but start with "My requirements..." (Read as:I haven't bothered, you can do it...)

    After saying that, it was necessary to see your code because of the myriad of properties you set before exporting. Rather than try to understand everything going on, I edited a couple of procedures (to test) by adding an optional parameter set to True by default.

    This was done so there would be no effect on your existing calls to those procedures. The procedures are below (Note: all of the lines to set the properties have been removed to aid reading)
    Please Login or Register  to view this content.
    The major difference is the IF block near the end. If the procedure is called from the 'combined' procedure that will be set False. Defaulting to True means none of your existing code to call that procedure need change.

    Another changed proc
    Please Login or Register  to view this content.
    And finally a procedure to call each procedure (to set the page properties), select the sheets you want to merge and create the PDF

    Please Login or Register  to view this content.
    You need to edit your existing procedures as above and you also need to make sure the correct sheet is active or edit the procedure to refer to the correct sheet when setting the properties...


    Simple enough but workbook was essential.

    I also notice you have requested this thread be deleted...
    Thank you so much :D :D You have been so helpful thank you thank you thank you, sorry I learned my lesson - will always have the workbook attached.

    The only thing cytop is that when I run the print all macro after doing all edits as you suggested - it indeed works but it completely screws up the format and sizes of Macro buttons on the New Provider tab, Training tab, and Access management... It's really odd. I can't even put the size back to normal. They shrinked into tiny squares that I can only see when I zoom in +200%. Do you know what could be causing this?

    [PS - I requested the post to be deleted before I knew I could attach the attachment]

  11. #11
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: How to call all my already created macros with one button, print one report [easy]

    Seems to be an issue that we see after running - but it is actually not there when you save and reopen.... it's weird but I will work with it

  12. #12
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: How to call all my already created macros with one button, print one report [easy]

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

+ 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. [SOLVED] one button to call 3 macros
    By hankey999 in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 11-19-2015, 09:17 PM
  2. How can i print filter report or move to new workbook by click command button
    By Nisar.mohammed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2014, 09:01 AM
  3. Replies: 0
    Last Post: 06-22-2014, 04:18 PM
  4. How to call a function from a ComandButton on an excel sheet created dynamically
    By ravikanth180 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2013, 04:25 AM
  5. [SOLVED] Use one command button to 3 check boxes with different call macros
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2012, 09:59 AM
  6. Click events on buttons created at runtime only work on the last button created
    By Treacle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2010, 05:44 AM
  7. Replies: 2
    Last Post: 07-27-2005, 11:05 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