+ Reply to Thread
Results 1 to 2 of 2

Dependent Combobox based on Option Buttons

Hybrid View

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Phoenix, Az
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    20

    Dependent Combobox based on Option Buttons

    Hey everyone

    I am having to make changes to my userform and I thought i had got the code working. I have created Option buttons for the reports and have the code set. I need to link ComboBox2 to the Option Buttons. If a end user selects VDPS, only the options on the tab "VDPS" will appear in the Combo Box. i wrote the module but I'm getting hung up somewhere. I also would like the items highlighted in yellow on the userform to only be visible if the end users select the "VDPS" option button. Anyone have any thoughts were I'm going wrong?

    I have altered all the Option Buttons like so: I have 4 option buttons

    Private Sub OptionButtonEtran_Click()
    OptionChange (1)
    End Sub
    I wrote the Module like this

    Sub OptionChange(myOption As Long)
    Dim Limit As Long
    Select Case myOption
        Case 1
            Limit = Sheets("Hogan").Cells(Rows.Count, 3).End(x1Up).Row
            DinnerPlannerUserForm.ComboBox2.ListFillRange = "WR!A1:A" & Limit
        Case 2
            Limit = Sheets("Etran").Cells(Rows.Count, 3).End(x1Up).Row
            DinnerPlannerUserForm.ComboBox2.ListFillRange = "WR!A1:A" & Limit
        Case 3
            Limit = Sheets("Fraud").Cells(Rows.Count, 3).End(x1Up).Row
            DinnerPlannerUserForm.ComboBox2.ListFillRange = "WR!A1:A" & Limit
        Case 4
            Limit = Sheets("VDPS").Cells(Rows.Count, 3).End(x1Up).Row
            DinnerPlannerUserForm.ComboBox2.ListFillRange = "WR!A1:A" & Limit
    End Select
    End Sub

  2. #2
    Registered User
    Join Date
    10-25-2012
    Location
    Phoenix, Az
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    20

    Re: Dependent Combobox based on Option Buttons

    i attempted to post the actual userform but the site says its too large.

+ 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. [SOLVED] ComboBox and Option Buttons
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2013, 11:54 AM
  2. [SOLVED] Multiple option buttons - Need VBA to disable second group of option buttns based on respo
    By ex123 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-19-2013, 03:30 AM
  3. [SOLVED] Option Buttons to Change ComboBox Values Dynamically
    By Stonesteel15 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2012, 11:48 PM
  4. [SOLVED] Disabling an Entire Frame with Option Buttons if other Option Buttons are not clicked.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2012, 04:07 AM
  5. Selecting AutoFilter option based on ComboBox value
    By clmarquez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2005, 09:24 PM

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