Hi guys,
I am not sure if this is possible, but I wanted to give it a try. I am working with userforms on excel. One of the userform is called "frmTrials" and on it I have a ComboBox1 that the user may choose from 1 to 3. Based on that decision a second userform is openned called "frmComp" where I have three frames. If the user choose 1 then when the frmComp appears, only one frame will be visible and so on. On each frame I have another combobox (where for frame 1 is called cmbLCateg1, for frame 2 is called cmbLCateg2....)
cmbLCateg1, cmbLCateg2 and cmbLCateg3 all have the same information for the user to choose but based on that I will have the textbox underneath the combobox be visible or not.
Here is the question:
Since all 3 combobox have the same information and are supposed to work the same way, can I write a code where my combobox is a variable,
something like:
and then have another sub that will know if I am changing cmbLCateg1 which will assign X = 1 and then call the above code fro X =1.
Thank you so much for any help.
I am not sure if this is possible, but I wanted to give it a try. I am working with userforms on excel. One of the userform is called "frmTrials" and on it I have a ComboBox1 that the user may choose from 1 to 3. Based on that decision a second userform is openned called "frmComp" where I have three frames. If the user choose 1 then when the frmComp appears, only one frame will be visible and so on. On each frame I have another combobox (where for frame 1 is called cmbLCateg1, for frame 2 is called cmbLCateg2....)
cmbLCateg1, cmbLCateg2 and cmbLCateg3 all have the same information for the user to choose but based on that I will have the textbox underneath the combobox be visible or not.
Here is the question:
Since all 3 combobox have the same information and are supposed to work the same way, can I write a code where my combobox is a variable,
something like:
Code:
Private Sub cmbLCategX_Change()
''' here I will have my code that is dependent of frmTrials and cmbLCategX (where X can be from 1 to 3 to fufill my three combobox above)
End Sub
and then have another sub that will know if I am changing cmbLCateg1 which will assign X = 1 and then call the above code fro X =1.
Thank you so much for any help.