Hi VBA users!
Please I need some help to solve a problem that I have with an UserForm. I explain the situation.
I have more than 20 combobox into the Userform which have the same options (Yes, No, N/A)
I tried to create a class module but it doesn't work.
The code:
Into the UserForm:
sub Combobox1_Change()
Dim Combo_GPS As Combos
Set Combo_GPS.value = New combos
Combo_GPS.Change_Combo
set Combobox1 = Nothing
end sub
Into class module (the value in red generates the error)
Public Sub Change_Combo()
Select Case Combos.Value
Case "N/A"
Selected_Combo.BackColor = RGB(150, 150, 150) 'grey
Case "No"
Selected_Combo.BackColor = RGB(255, 0, 0) 'red
Case "Sí"
Selected_Combo.BackColor = RGB(0, 255, 0) 'green
Case "En curso"
Selected_Combo.BackColor = RGB(255, 230, 0) 'yellow
End Select
Basically I want to call this class module each time that I need to use this code to avoid repeat for each combobox.
If you have the solution or better idea, I will appreciate it a lot.
Note: please explain for rookies, I am not advanced for Macros, I am trying to learn, but this kind of explanation don't appear on Internet ^^
Thanks!
Bookmarks