+ Reply to Thread
Results 1 to 6 of 6

Macro: Drop Down Menu Selection Inserts Templated Rows

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro: Drop Down Menu Selection Inserts Templated Rows

    Hey guys,

    I was hoping someone could help me out with some VBA code! Basically, I would like to create a drop down menu that identifies a number of "selections" (through data validation) and inserts templated rows (from another sheet) for every "selection". For example, if "3 Selections" is chosen in the drop down, 3 sets of templated rows are inserted beneath. I would appreciate any help! Thanks.

  2. #2
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Macro: Drop Down Menu Selection Inserts Templated Rows

    Hi,

    Could you post an example workbook of your data?

    ...
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  3. #3
    Registered User
    Join Date
    06-27-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro: Drop Down Menu Selection Inserts Templated Rows

    Attached is a sample workbook that I created for purposes of this Macro as I cannot attach the actual data I am working with. Basically, in Row 3 in the "Pricing Module" worksheet, you can select a number from 1-20. Based on that selection, I would like Rows 5:27 on the "Templated Rows" worksheet to be repeated (going down) however many times is selected. For sake of this example, I have copied and pasted how the "Pricing Modules" worksheet should look after the Macro has run for a "3" selection. Thanks in advance for any help you can offer!
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Macro: Drop Down Menu Selection Inserts Templated Rows

    Maybe you could try this: Goes in the sheet code that the drop down box is on.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-27-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro: Drop Down Menu Selection Inserts Templated Rows

    Thank you so much for your help, I truly appreciate it! Can you clarify what "Goes in the sheet code that the drop down box is on" means a bit? Based on the code, I believe this will serve my purpose, just a bit unsure of how to embed the code in the drop down box!

  6. #6
    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: Macro: Drop Down Menu Selection Inserts Templated Rows

    Hi nealshah4

    From looking at your code, I suspect this is more of what you're looking for.
    Please Login or Register  to view this content.



    To insert the code:
    1. Copy the code
    2. Right click on sheet tab "Pricing Module"
    3. Select "View Code"
    4. Paste the code into the window on the right
    5. Code will run when you change Cell B3 of Pricing Module
    Code is in the attached. Let me know of issues.
    Attached Files Attached Files
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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