Using ControlSource property in Textbox in UserForm

R

rick

I have a workbook with 12 sheets, a userform and a couple of modules. This
is my first foray into using a UserForm for data entry. I run the UserForm
from a customized ribbon tab. I would like to set the ControlSource property
in a textbox to a sheet called "UserData" into cell B4.
When I try to enter Worksheets("UserData").Range("B4") (or all combinations)
I get an error: "Could not set the ControlSource property. Invalid property
value."

Could you please explain how I do this properly?

Thanks very much.

... rick
 
D

Dave Peterson

I like:

TextBox1.ControlSource _
= worksheets("UserData").range("B4").address(external:=true)

Then I never have to worry about the syntax.
 
R

rick

Thank you very much OssieMac and Dave Peterson. It looks like I can't put
the target into the Property sheet's controlsource but it works within a
subroutine of the UserForm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top