View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Passing the Name of a Control Between Macros

Private Sub Userform_Initialize()
SetRowSource me.Combobox1
End Sub


Sub SetRowSource(xControlName as MSForms.Combobox)
xControlName.RowSource = "Sheet1!A1:A20"

End Sub

--
Regards,
Tom Ogilvy


"Sandy" wrote in message
...
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.