Passing the Name of a Control Between Macros
Hi,
Sub main()
Dim ControlName As String
MyControlName = "combobox1"
Call SetRowSource(MyControlName)
UserForm1.Show
End Sub
Sub SetRowSource(xControlName)
UserForm1.Controls(xControlName).RowSource = "a1:a5"
End Sub
HTH
"Sandy" wrote:
I have a user form with a ComboBox
UserForm1.ComboBox1
I need to pass the control name to a macro and set the row source in the
called macro.
Sub SetRowSource(xControlName)
...... Code
End Sub
It's the ...... Code that has me confused. What should it be? I appreciate
your help. Thanks.
|