+ Reply to Thread
Results 1 to 8 of 8

VBA Batch Print Error

  1. #1
    Registered User
    Join Date
    03-30-2016
    Location
    2
    MS-Off Ver
    2010
    Posts
    26

    VBA Batch Print Error

    I am trying to run a VBA code that batch prints workout cards for each name in a drop down list. I have had some level of success, where a print button embedded in the worksheet "GPP" will work the assigned VBA code to PrintAllCards (located in module 2). Unfortunately, the code is only printing the first name from the drop down list, and is printing copies of the first card multiple times. I have 3 sample names, and am expecting 1 print out of the specific cards for each of the three names (Sample 1, Sample 2, and Sample 3) and instead am getting the card for Sample 1 printed out 3 times.

    I modified the VBA code from a gradebook template I found through office help, so it is very likely that I have just missed something in the coding.

    Here is what I have currently:
    Please Login or Register  to view this content.
    Thank you for any help!
    Attached Files Attached Files
    Last edited by sh1483; 05-09-2016 at 11:03 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA Batch Print Error

    Try it like this - I have changed the code to loop through your list of athlete names on Settings - and have made that range dynamic so that you can add or delete names easily - just don't leave any blank spaces in your list of names.

    Here is the code I use:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    03-30-2016
    Location
    2
    MS-Off Ver
    2010
    Posts
    26

    Re: VBA Batch Print Error

    Awesome, thank you!

    If I want to apply this to more sheets (Hypertrophy1-3, Strength1-3, and Power1-3) I just introduce those Sheet #'s in the VBA code as you've done for Sheet8 and Sheet9? Does this print every card for every sheet, or just for the current sheet that I am viewing? If I just want to print a certain sheet, would I just write the code to reference each individual sheet, and then apply that to a different Print button on each sheet?

    Lastly, is there a way for the button to bring up a box where I can either select all athletes to print, or just specific ones (in case I need to update just a few individual cards and print only them)?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA Batch Print Error

    Try this macro, assigning it to a button on each sheet - it will only print cards based on the current sheet. If you decide to choose which athletes to print cards for, the macro will ask about each one.

    Please Login or Register  to view this content.

    You could also modify your Settings sheet to include a column next to the athletes name column, to show whether they should be printed or not - with this code, any entry in column B next to the name will cause the card to print for that athlete.

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 05-09-2016 at 04:51 PM.

  5. #5
    Registered User
    Join Date
    03-30-2016
    Location
    2
    MS-Off Ver
    2010
    Posts
    26

    Re: VBA Batch Print Error

    Amazing! Thank you so much!

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: VBA Batch Print Error

    Anything for a soccer coach! My daughter was a Division III player, and I was a long-time youth coach and am still a much-abused referee

  7. #7
    Registered User
    Join Date
    03-30-2016
    Location
    2
    MS-Off Ver
    2010
    Posts
    26

    Re: VBA Batch Print Error

    Tested the code this morning and ran into the same issue of printing only the current selection from the drop down list. Is it possible to automatically loop through all of the names on the drop down list printing each card?

  8. #8
    Registered User
    Join Date
    03-30-2016
    Location
    2
    MS-Off Ver
    2010
    Posts
    26

    Re: VBA Batch Print Error

    Never mind, I figured it out!

+ 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. Batch Print cheque from form template
    By seolann in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-24-2019, 04:47 AM
  2. Print Multiple Sections in One Batch
    By MrsAlice in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2013, 09:48 PM
  3. batch print from list box?
    By tsiguy96 in forum Excel General
    Replies: 8
    Last Post: 02-06-2013, 03:01 PM
  4. Batch print or another solution
    By Mtes in forum Excel General
    Replies: 0
    Last Post: 09-03-2012, 08:12 AM
  5. Batch Print workbooks.
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2011, 05:13 AM
  6. Print batch of files via hyperlinks
    By excelbry in forum Excel General
    Replies: 0
    Last Post: 03-31-2011, 05:40 AM
  7. Can I batch print several files at once with Excel?
    By blueberry in forum Excel General
    Replies: 0
    Last Post: 07-19-2006, 04:45 PM
  8. [SOLVED] Need2 batch print all the workbooks in 25 worksheets in one step
    By richie s. in forum Excel General
    Replies: 2
    Last Post: 06-26-2006, 10:46 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