+ Reply to Thread
Results 1 to 12 of 12

Fill data based on multiple drop down selections on a heading page

  1. #1
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Fill data based on multiple drop down selections on a heading page

    Hello,

    I am trying to get this vba code to work so that when a options is selected for the zone 1 drop down menu for instance if plank is selected itll put those rooms with a quantity on the plank page but if sheet vinyl is selected itl do the same thing. I just cant seem to get the code to work :/ ..... this is the code that i have and the attached workbook

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ws1 As Worksheet, ws2 As Worksheet
    Dim rng As Range

    Application.EnableEvents = False
    If Not Intersect(Target, Range("H14:H18")) Is Nothing Then

    Set ws1 = Worksheets("DEF_ZONES") ' tables of Rooms per Zone
    Set ws2 = Worksheets(Target.Value) ' Product type e.g "Sheet Vinyl"
    zone = Replace(Target.Offset(0, -1), " ", "_") ' Named Range of Zones
    Set rng = ws1.Range(zone)
    With ws2
    irow = 14
    Do While .Cells(irow, 2) <> "" ' find second blank cell
    irow = irow + 1
    Loop
    For Each c In rng
    .Cells(irow, 2) = c
    irow = irow + 1
    Next c
    End With

    End If

    Application.EnableEvents = True

    End Sub
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    I am assuming the code is in the code behind for the worksheet named Heading. It works perfectly for me with one caveat:
    Whenever you choose an option that does not have a worksheet with the name of the options selected you get a subscript error. For example, on of the choices you give is "Tile" another is "Upgraded Carpet". Well, you don't have sheets with matching names. The options have to match the sheet names. So instead of the option being "Tile" it needs to be "Floor Tile" or "Wall Tile" as you have worksheets with those names but you don't have a worksheet named "Tile".
    If I was able to help you, you can thank me by clicking the Add Reputation button below and marking the thread Solved.

  3. #3
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Re: Fill data based on multiple drop down selections on a heading page

    Hello, the main problem I am having is for it to show the quantity with the zones in the quantity column and I had help making the code and I need the zones to show up with the rooms as well but im dumb and cant figure it out :/

  4. #4
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    So what exactly is the source for the quantity you are trying to paste? I don't see quantities on the "Heading" worksheet or on the "DEF_ZONES" worksheet so I don't know what quantities to copy in.

  5. #5
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Re: Fill data based on multiple drop down selections on a heading page

    they are on the PLANS-ZONES tab

  6. #6
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    To test my understanding do I understand this example? If the PLAN is 29201 then in ZONE 1 there is ENTRY 1, POWDER 1, LAUNDRY 1, and BATH 2?

  7. #7
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Re: Fill data based on multiple drop down selections on a heading page

    That would be correct so it would be put in order as
    zone 1
    enry
    powder
    laundry
    bath 2
    total

    on the excel sheet down in one columm and then lets says zone 2 is to go on the same sheet it would be in the same format just with one row left blank between the "total" from zone 1 and "zone 2"

  8. #8
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    Okay, then this code should do it:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Re: Fill data based on multiple drop down selections on a heading page

    Awesome! Thank you i really do appreciate your time into doing that for me. My one last question is how to i extend the VBA range so on the def-zones tab to get it to include the zones into it instead of just the rooms ?

  10. #10
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    I'm not sure I understand the question. Are you saying you want to identify the zones based on plan or add additional zones to the DEF_ZONES sheet or include the ZONE names in the material sheets before the room names; okay I'm done guessing - I don't really understand what you are trying to do.

  11. #11
    Registered User
    Join Date
    08-12-2021
    Location
    DENVER, CO
    MS-Off Ver
    VERSION 2107
    Posts
    14

    Re: Fill data based on multiple drop down selections on a heading page

    Sorry i suppose that is what happens when someone who doenst really know how to explain it tries to explain it when they dont really understand the concept of how it works but im just wanting it to be so it also includes "zone 1" above the rooms instead of just having the rooms

  12. #12
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Fill data based on multiple drop down selections on a heading page

    Got it. Here you go:
    Please Login or Register  to view this content.

+ 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. Fill date based on multiple drop down selections
    By KOTZBROCKEN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2021, 02:11 AM
  2. Fill data based on multiple drop down selections on a heading page
    By KOTZBROCKEN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2021, 02:09 AM
  3. Replies: 0
    Last Post: 06-14-2019, 03:28 PM
  4. [SOLVED] Populate data based on several drop down selections
    By NerdALRT in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2014, 03:42 PM
  5. [SOLVED] Update respective cell value based on Multiple Drop Down list selections
    By nileshpatil in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-16-2012, 08:43 AM
  6. Filter data in one tab based on drop down selections in a different tab
    By ragonef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2012, 09:27 AM
  7. Fill table using drop down list data selections
    By Lasthitlarry in forum Excel General
    Replies: 2
    Last Post: 07-10-2009, 06:03 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