Multiple ComboBoxes and TextBoxes on Userform
I am doing that in each
private Sub ComboBox#_change()
R= 5 <-corresponds to the row on the spreadsheet
subroutine <- goes to a routine that modifies various cells in that row
end sub
I wrote that 22 times for the comboboxes and 44 times for the textboxes that need to have data added
I wanted to know if there is code to detect when any combobox or textbox is changed no matter which one
it is. Instead of having 66 subroutines, one for each, I want to be able to detect CBOX.name and TBOX.name and extract the number from the name and use it to calculate R.
ex.
PRIVATE SUB ANYCTRL_CHANGE()
If Type of CTRL is MSForms.ComboBox Then
CBOX.name = combobox502
TEMP = right(CBOX.name,3) <- would extract 502 as text from name of combobox
R = (TEMP * 1) - 497 <- *1 would convert to integer and then R would be 5
ELSEIF Type of CTRL is MSForms.TextBox Then
|