+ Reply to Thread
Results 1 to 14 of 14

[SOLVED] Macro to Print All Options in a Drop Down List

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    [SOLVED] Macro to Print All Options in a Drop Down List

    Hi There,

    I have a work book here with 3 sheets:

    1. Sheet one - list of Markets
    2. Sheet two - Data
    3. Sheet three - formatted with a range of B1:I109 that needs to be printed. Drop down list of 90 markets in C2 (linked to Sheet 1) which changes the data in the range C6:I109 based on vlookups.

    I need help writing a macro that will print 90 pages, 1 for each market in the drop down with that markets data populated from the vlookup.

    Could someone help me with writing a macro for this?

    Thank you!

    LC
    Last edited by lianne.cuscani; 08-06-2015 at 01:38 PM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Macro to Print All Options in a Drop Down List

    Can you attach a sample workbook to find quick help?
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Macro to Print All Options in a Drop Down List

    HI There!

    Attached is an example - the number of tabs and formulas are the same, just generic data.

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Macro to Print All Options in a Drop Down List

    Try this code
    Please Login or Register  to view this content.
    Replace PrintPreview with PrintOut to Print all markets

  5. #5
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Macro to Print All Options in a Drop Down List

    This only works on the example file I gave you.

    I changed the market names to protect information. Each Market name is unique. For example- Market 1 in my real file would be ABC Grocery, Market 2 would be 123 Grocery, etc (those aren't the names, just trying to provide an example)

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Macro to Print All Options in a Drop Down List

    You can clear data validation list from C2 and put this formula in C2
    Please Login or Register  to view this content.
    then in G2 right click then format cells then select Custom and type
    Please Login or Register  to view this content.
    Now change the code to :
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Macro to Print All Options in a Drop Down List

    Another way to run this code directly without changing your file structure
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Macro to Print All Options in a Drop Down List

    Hi! It's almost there! I used the most recent code you provided and its working except its only printing up to column F instead of column I

  9. #9
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Macro to Print All Options in a Drop Down List

    OMG, my page layout was just wrong - that is the problem with the columns not showing.

    Now my only issue is the sheet is too long so it prints 2 pages per market, but the macro print preview is just showing the first page.

  10. #10
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Macro to Print All Options in a Drop Down List

    Everything is working - thank you for your help!!!

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: [SOLVED] Macro to Print All Options in a Drop Down List

    You're welcome. Thanks for the feedback and for the rep. points

  12. #12
    Registered User
    Join Date
    06-30-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: [SOLVED] Macro to Print All Options in a Drop Down List

    Hi YasserKhalil!

    I was wondering if you could help me adapt this code for another spreadsheet. I tried changing the range, and worksheet names, but it will only print the first selection in a range of 3 selection. Does it have something to do with the SH or I? Thanks!

    Sub PrintAll()
    Dim SH As Worksheet, I As Long
    Set SH = Sheets("Formated Data")
    Application.ScreenUpdating = False
    For I = 1 To 90
    SH.Range("C2").Value = Sheets("Markets").Cells(I, 1)
    SH.PrintPreview
    'SH.PrintOut
    Next I
    Application.ScreenUpdating = True
    End Sub

  13. #13
    Registered User
    Join Date
    09-15-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    10

    Re: [SOLVED] Macro to Print All Options in a Drop Down List

    Hi,
    I need help on what I think is this exact same issue, but the solutions posted in the past are not loaded. I'd like to print the worksheet "Scorecard" (A1:Q39) for each of the options in C12. Any help would be appreciated!
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    01-25-2018
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    1

    Re: [SOLVED] Macro to Print All Options in a Drop Down List

    Hello! Can you help me too? I don't know ANYTHING about macros so I can't edit the one you posted for lianne.cuscani beyond the two changes in red (below).

    I have 3 tabs. The dropdown is on the "Selection" tab in cell C3. It is looking at the list on "Inputs" in cells DB3:DB205. The area to print is on "Overview" in cells B2:S62.


    Sub PrintAll()
    Dim SH As Worksheet, I As Long
    Set SH = Sheets("Formated Data")
    Application.ScreenUpdating = False
    For I = 1 To 90
    SH.Range("C3").Value = Sheets("Inputs").Cells(I, 1)
    SH.PrintPreview
    'SH.PrintOut
    Next I
    Application.ScreenUpdating = True
    End Sub

+ 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 for drop down list options with different increases
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-10-2015, 04:43 AM
  2. Print all options from dropdown list to PDF and name the files the exact names in the list
    By johnwilliamboyle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2014, 11:49 AM
  3. Autoselect from a drop-down list and print (macro)
    By Jejeje in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2014, 02:56 PM
  4. drop down list with options
    By kayye in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2013, 12:06 PM
  5. [SOLVED] Column B drop down list with 2 options, columns C & E with dependent drop down lists
    By betic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-26-2012, 03:47 PM
  6. Take away options in drop-down list
    By phiberjenz in forum Excel General
    Replies: 0
    Last Post: 04-16-2009, 04:44 AM
  7. [SOLVED] My Excel drop-down list eliminates from list options chosen. Help
    By Sybil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2006, 05:25 PM

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