Dependent Dropdown (VBA)

Robby19

Board Regular
Joined
Mar 19, 2018
Messages
227
Good day!

Looking for some help in creating a dependent dropdown (combo box) on a User from. The Named Ranges are being pulled from tables.

Basically it needs to run like this;

If ExpIncDrop (Combo box) = "Expense"
Then TypeDrop (Combo box) = ExpenseType (Defined Named Range)
Else TypeDrop (Combo box) = IncomeType (Defined Named Range)

ExpenseType and IncomeType is a defined named range both in separate tables.
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try this

Code:
Private Sub TypeDrop_DropButt*******()
    Dim Rng As Range
    Set Rng = Range("Income")
    If ExpIncDrop.Value = "Expense" Then Set Rng = Range("Expense")
    TypeDrop.List = Application.WorksheetFunction.Transpose(Rng)
End Sub
 
Last edited:
Upvote 0
How strange - I can see asterisks in the post above :confused:
- tried several times and it refuses to display correctly in the post window

Remove the space between Button and Click below !!

Code:
Private Sub TypeDrop_Drop[COLOR=#ff0000]Button[/COLOR] [COLOR=#ff0000]Click[/COLOR]()
    Dim Rng As Range
    Set Rng = Range("Income")
    If ExpIncDrop.Value = "Expense" Then Set Rng = Range("Expense")
    TypeDrop.List = Application.WorksheetFunction.Transpose(Rng)
End Sub
 
Last edited:
Upvote 0
Haha. I see the asterisks too. I was going through each and every selection to figure it out. Thank you! It works!!
 
Upvote 0

Forum statistics

Threads
1,224,951
Messages
6,181,973
Members
453,079
Latest member
hps1972

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top