Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8771297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:44:59+00:00 2026-06-13T17:44:59+00:00

I want fill a drop down list based on user selection in another. I’m

  • 0

I want fill a drop down list based on user selection in another. I’m trying to update the contents of a field based on selection in another by adding the items on the fly once the first combobox (cbo_park) is selected.

I have a four drop down lists:

The first drop down cbo_park has the following options:

Central
East
West

I have a second workbook called lookupRoom which contains the following table:

roomCode    park
A.0.01      Central 
A.2.01      Central 
A.3.01      Central 
HE.0.10     East
HE.0.21     East
HE.0.22     East
KG.1.07     West
KG.1.09     West
KG.1.10     West

When the user selects the Central park option under the first drop down cbo_park I only want rooms in the Central park to be displayed in dropdown cbo_prefRoom1, cbo_prefRoom2 and cbo_prefRoom3. How would I go about achieving this?

Please find below my attempts so far. I keep receiving an error at the line: Me.cbo_prefRoom1.RemoveItem 0.

Private Sub cbo_park_Change()

Dim lLoop As Long, rgLoop As Range

    For lLoop = 1 To Me.cbo_park.ListCount

        Me.cbo_prefRoom1.RemoveItem 0

    Next lLoop

    Sheets("lookupRoom").[a1].CurrentRegion.AutoFilter
    Sheets("lookupRoom").[a1].CurrentRegion.AutoFilter Field:=3, Criteria1:=Left(Me.cbo_park.Value, 2)

    For Each rgLoop In Sheets("lookupRoom").[a1].CurrentRegion.Offset(1).SpecialCells(xlCellTypeVisible).Columns(1).Cells
        If Len(rgLoop) > 0 Then
            Me.cbo_prefRoom1.AddItem rgLoop
        End If
    Next rgLoop

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:45:01+00:00Added an answer on June 13, 2026 at 5:45 pm

    Below is my solution for achieving this.

    I rewrote everything to be contained in just the one For loop and set it to update both comboboxes.

    Private Sub cbo_park_Change()
    
        Dim lLoop As Long
        '- clear the two comboboxes we are about to update
        Me.cbo_prefRoom1.Clear
        Me.cbo_prefRoom3.Clear
    
        '- loop through the worksheet and test each row
        For lLoop = 1 To Sheets("lookupRoom").Range("A" & Sheets("lookupRoom").Rows.Count).End(xlUp).Row
            '- if the row's column C matches the combobox then add the corresponding values to other combos
            If Sheets("lookupRoo"m).Range("C" & lLoop).Value = Me.cbo_park.Value Then
                Me.cbo_prefRoom1.AddItem Sheets("lookupRoom").Range("B" & lLoop).Value
                Me.cbo_prefRoom2.AddItem Sheets("lookupRoom").Range("B" & lLoop).Value
            End If
        Next lLoop
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want fill a drop down list based on user selection in another. Can't
I Had Drop down list and I want to fill it with data from
I want to add Drop Down List html control to the web page fill
I had drop down list and I want to fill it with data by
I am trying to fill my view model with some drop down options from
I want fill five years in a drop-down using javascript and the years will
I have two tables: I want to fill an ASP.NET server control drop down
I want to create a form for my user which shows a drop down
I want to fetch a selected value from a drop down 'select' list of
I want to build a dynamic navigation menu that will fill in automatically based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.