sllaksvb
08-15-2017, 01:56 PM
Hi all,
I am relatively new to VBA and would require some help on a matter.
I am trying to run macros from the items in my combo box, and my combo box will be populated from a range on a different sheet (therefore the items in my combo box can change).
I am only familiar with calling macros using the exact values in the combo boxes, but seeing that the names change, I can not use the exact values.
My current code is:
Private Sub cmbaccdet_Change()
Select Case cmbaccdet.Value
Case "1"
Call FirstAccount
Case "2"
Call SecondAccount
End Select
End Sub
Is there something I can use to replace the 1 & 2 so that it calls the first and second option in the combo box without having to refer to them as "1" and "2"?
Thank you for your help!
I am relatively new to VBA and would require some help on a matter.
I am trying to run macros from the items in my combo box, and my combo box will be populated from a range on a different sheet (therefore the items in my combo box can change).
I am only familiar with calling macros using the exact values in the combo boxes, but seeing that the names change, I can not use the exact values.
My current code is:
Private Sub cmbaccdet_Change()
Select Case cmbaccdet.Value
Case "1"
Call FirstAccount
Case "2"
Call SecondAccount
End Select
End Sub
Is there something I can use to replace the 1 & 2 so that it calls the first and second option in the combo box without having to refer to them as "1" and "2"?
Thank you for your help!