User FAQs

If you have a question, please send it to us.


1) What can the ControlSource property of a textbox be used for ?
You can enter a cell reference, for example "A1" into this property to link it to the cell "A1" on the active worksheet.
This binding can even be seen when the userform is in design mode.
If you want to bind the textbox to a specific worksheet, you can prefix it with the name of the worksheet ("MySheet!A1").
An alternative to using the ControlSource property is to use the Userform_Initialise event and the TextBox_Change event.

Public Sub Userform_Initialise() 
   Me.TextBox.text = worksheets("MySheet").Range("A1").Value
End Sub
Public Sub TextBox_Change()
   Worksheets("MySheet").Range("A1").Value = Me.TextBox.Text
End Sub

Other controls with this property are:
ComboBox, ListBox, CheckBox, OptionButton, ToggleButton, ScrollBar and SpinButton.
more details


2) What can the RowSource property of a listbox or combobox be used for ?
more details



3) What can the SetFocus method be used for ?
This can be used to switch the focus to a particular control.

Me.TextBox.SetFocus() 

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext