Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Textbox questions

2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Textbox questions

Yes to both.
1) Do you mean a textbox on a userform? Copying is straightforward:
UserForm1.TextBox1 = Sheets("Sheet1").OLEObjects("TextBox1").Object.Val ue
Forms toolbar does not allow me (in XP) to create a textbox on a sheet - If
you mean a textbox from the drawing toolbar, then to get the text (left side
of above equation) it would be:
Sheets("Sheet1").Shapes("Text Box 1").TextFrame.Characters.Text
If it is indeed a Forms control (earlier version of Excel?) then it would be:
Sheets("Sheet1").Shapes("TextBox1").ControlFormat. Value

2) Again, assuming you are talking about a Userform, any control has a top,
left, height and width property that you can use to set size and position, in
points. You can do the same with Shape objects on a worksheet (including
both the forms controls and ActiveX controls, since both are "contained" in a
Shape).

"Stuart" wrote:

2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Textbox questions

1. don't think you need to use copy. Just assign.

worksheets("Sheet1").Textboxes("Text Box 1").Text = _
Userform1.Textbox1.Text

If you run into problems with string length, then you can use the characters
method to transfer the string 255 characters at a time.

2. The activeX textbox is positioned relative to the top left corner of the
userform, so the top and left properties should do it.

--
Regards,
Tom Ogilvy



"Stuart" wrote in message
...
2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Textbox questions

Many thanks for the help.
Will post back if problems remain.

Regards.

"K Dales" wrote in message
...
Yes to both.
1) Do you mean a textbox on a userform? Copying is straightforward:
UserForm1.TextBox1 = Sheets("Sheet1").OLEObjects("TextBox1").Object.Val ue
Forms toolbar does not allow me (in XP) to create a textbox on a sheet -
If
you mean a textbox from the drawing toolbar, then to get the text (left
side
of above equation) it would be:
Sheets("Sheet1").Shapes("Text Box 1").TextFrame.Characters.Text
If it is indeed a Forms control (earlier version of Excel?) then it would
be:
Sheets("Sheet1").Shapes("TextBox1").ControlFormat. Value

2) Again, assuming you are talking about a Userform, any control has a
top,
left, height and width property that you can use to set size and position,
in
points. You can do the same with Shape objects on a worksheet (including
both the forms controls and ActiveX controls, since both are "contained"
in a
Shape).

"Stuart" wrote:

2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Textbox questions

Many thanks.

your answer to Q2 suggests that something I've been
looking at all weekend may be possible ... namely placing
an ActiveX textbox on a Userform

Q3 is that possible, and how?

Q4 if so, can I have both a standard textbox AND an
ActiveX textbox (both being the same size and
occupying the same position on the Userform) and
toggle between the two?

Regards.

"Tom Ogilvy" wrote in message
...
1. don't think you need to use copy. Just assign.

worksheets("Sheet1").Textboxes("Text Box 1").Text = _
Userform1.Textbox1.Text

If you run into problems with string length, then you can use the
characters
method to transfer the string 255 characters at a time.

2. The activeX textbox is positioned relative to the top left corner of
the
userform, so the top and left properties should do it.

--
Regards,
Tom Ogilvy



"Stuart" wrote in message
...
2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Textbox questions

The textbox on a userform is an activeX textbox. You can place it there in
the VBE just like any other control.

You can't put a drawing toolbar textbox on a userform. You can have two
multiple acitvex controls on a userform in the same location and with the
same size and make only one visible at a time.

--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
Many thanks.

your answer to Q2 suggests that something I've been
looking at all weekend may be possible ... namely placing
an ActiveX textbox on a Userform

Q3 is that possible, and how?

Q4 if so, can I have both a standard textbox AND an
ActiveX textbox (both being the same size and
occupying the same position on the Userform) and
toggle between the two?

Regards.

"Tom Ogilvy" wrote in message
...
1. don't think you need to use copy. Just assign.

worksheets("Sheet1").Textboxes("Text Box 1").Text = _
Userform1.Textbox1.Text

If you run into problems with string length, then you can use the
characters
method to transfer the string 255 characters at a time.

2. The activeX textbox is positioned relative to the top left corner of
the
userform, so the top and left properties should do it.

--
Regards,
Tom Ogilvy



"Stuart" wrote in message
...
2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Textbox questions

Thanks for clearing up my confusion.
Regards.

"Tom Ogilvy" wrote in message
...
The textbox on a userform is an activeX textbox. You can place it there
in
the VBE just like any other control.

You can't put a drawing toolbar textbox on a userform. You can have two
multiple acitvex controls on a userform in the same location and with the
same size and make only one visible at a time.

--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
Many thanks.

your answer to Q2 suggests that something I've been
looking at all weekend may be possible ... namely placing
an ActiveX textbox on a Userform

Q3 is that possible, and how?

Q4 if so, can I have both a standard textbox AND an
ActiveX textbox (both being the same size and
occupying the same position on the Userform) and
toggle between the two?

Regards.

"Tom Ogilvy" wrote in message
...
1. don't think you need to use copy. Just assign.

worksheets("Sheet1").Textboxes("Text Box 1").Text = _
Userform1.Textbox1.Text

If you run into problems with string length, then you can use the
characters
method to transfer the string 255 characters at a time.

2. The activeX textbox is positioned relative to the top left corner
of
the
userform, so the top and left properties should do it.

--
Regards,
Tom Ogilvy



"Stuart" wrote in message
...
2 questions, please:

1. Can I copy the contents of an ActiveX textbox on a
sheet to a textbox created from the forms toolbar?

2. Can I establish (in points) the top left corner of the
form's textbox, relative to the top left corner of the
form itself?

Regards.










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
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
TextBox from Drawing toolbar - 2 questions Stuart[_5_] Excel Programming 2 July 27th 04 06:50 AM
Textbox Properties questions ForSale[_3_] Excel Programming 3 July 20th 04 04:57 AM
Further ActiveX Control (TextBox) questions Stuart[_5_] Excel Programming 0 July 4th 04 05:19 PM
2 Textbox questions Martin Koenig Excel Programming 5 April 5th 04 09:13 AM


All times are GMT +1. The time now is 01:12 AM.

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

About Us

"It's about Microsoft Excel"