Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Using ControlSource property in Textbox in UserForm

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Using ControlSource property in Textbox in UserForm

Hi Rick,

TextBox1.ControlSource = "UserData!B4"


--
Regards,

OssieMac


"rick" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using ControlSource property in Textbox in UserForm

I like:

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

Then I never have to worry about the syntax.

rick wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Using ControlSource property in Textbox in UserForm

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ControlSource and Localization Issue?? (run-time error '380' Could not set the ControlSource property) TCook Excel Programming 1 March 4th 07 08:12 AM
Could not set the ControlSource property. Invalid property value error Ömer Ayzan Excel Programming 2 October 31st 06 09:15 AM
Syntax for TextBox ControlSource Property to another worksheet jam9663 Excel Programming 2 October 7th 06 11:45 AM
ControlSource in a userform textbox Ian Mangelsdorf Excel Programming 1 October 18th 04 01:17 PM
Textbox ControlSource Property - Excel 97 Tom Ogilvy Excel Programming 0 June 17th 04 09:45 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"