Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Referring to a TextBox

Hi
I would like to be able to select text in a textbox for editing, based
on the selection of a worksheet cell.
e.g. selecting K4 means edit TextBox1
selecting K5 means edit TextBox2 and so on.

Using Textboxes from the Control Toolbox, I know that this works:

ActiveSheet.EditBox.Text = ActiveSheet.TextBox1.Text

(The text that needs editing is placed into a special edit textbox.)

I have tried a number of variations of the following without success:

Sub TestLoad()
Dim F1 As TextBox
Set F1.Name = "TextBox" & "2"
ActiveSheet.EditBox.Text = ActiveSheet.F1.Text
End Sub

How can I 'build' the textbox name to achieve what I would like ?

Any help appreciated.

Andrew B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Referring to a TextBox

I assume you are trying to dynamically choose which textbox you are modifying.



Hi
I would like to be able to select text in a textbox for editing, based
on the selection of a worksheet cell.
e.g. selecting K4 means edit TextBox1
selecting K5 means edit TextBox2 and so on.

Using Textboxes from the Control Toolbox, I know that this works:

ActiveSheet.EditBox.Text = ActiveSheet.TextBox1.Text

(The text that needs editing is placed into a special edit textbox.)

I have tried a number of variations of the following without success:

Sub TestLoad()
Dim F1 As TextBox
Set F1.Name = "TextBox" & "2"
ActiveSheet.EditBox.Text = ActiveSheet.F1.Text
End Sub

How can I 'build' the textbox name to achieve what I would like ?

Any help appreciated.

Andrew B

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 Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM
How to move cursor from one textbox control to another textbox con Tom Ogilvy Excel Programming 1 September 16th 04 03:42 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM


All times are GMT +1. The time now is 07:19 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"