I want to create a user-form with a combo box (CB1) and 2 text boxes (TB1 & TB2). Based on the input for CB1 and TB1, the output will show in TB2.
For CB1, there would be 4 different values:
And depending on which value is selected in CB1, it would trigger a vLookup value of TB1 into a different sheet, and input a value into TB2.
I'm fairly green in the user-form feature so looking for guidance. Thanks for any help.
Pseudocode:
If 'Search DB1' selected, find TB1 value in sheet1, column B, and return value into TB2
If 'Search DB2' selected, find TB1 value in sheet2, column Q, and return value into TB2
If 'Search DB3' selected, find TB1 value in sheet3, column T, and return value into TB2
If 'Search DB4' selected, find TB1 value in sheet4, column A, and return value into TB2
For CB1, there would be 4 different values:
Code:
Private Sub UserForm_Initialize()
CB1.AddItem "Search DB1"
CB1.AddItem "Search DB2"
CB1.AddItem "Search DB3"
CB1.AddItem "Search DB4"
End Sub
And depending on which value is selected in CB1, it would trigger a vLookup value of TB1 into a different sheet, and input a value into TB2.
I'm fairly green in the user-form feature so looking for guidance. Thanks for any help.
Pseudocode:
If 'Search DB1' selected, find TB1 value in sheet1, column B, and return value into TB2
If 'Search DB2' selected, find TB1 value in sheet2, column Q, and return value into TB2
If 'Search DB3' selected, find TB1 value in sheet3, column T, and return value into TB2
If 'Search DB4' selected, find TB1 value in sheet4, column A, and return value into TB2
Last edited: