Name

control.ControlSource [= setting]

Synopsis

Sets or returns the address of a range to use as the source of the value for the control. For example, the following code links the value in a text box to cell A1 on the DataForm worksheet:

    Private Sub UserForm_Initialize(  )
        TextBox1.ControlSource = "DataForm!a1"
    End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.