Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking a text box from one sheet to another text box on another sheet

Status
Not open for further replies.

accjrf

Technical User
Apr 1, 2004
39
US
I cannot find any information on how to do this. The reason that i am starting with a text box is because it allows users to hit the enter key to go to a new line. This spreadsheet is used to have a group of users enter comments explaining why sales trends may be down and they like to enter multiple comments. then i need to summerize several different divisional sheets into one company report. I am looking for a way to link the comments from a single text box into a different text box on another sheet.

thanks
 


hi,
Code:
Private Sub TextBox1_Change()
    Sheets("Sheet1").TextBox1.Text = Sheets("Sheet2").TextBox1.Text
End Sub


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip,

How do i get to the properties of the text box to put this as an "on change" command. right clicking on it and selecting the 'Assign a macro' puts it as an "on click" command and then i get an error 438 - Object doesnt support this property or method.

Sub TextBox1_Click()
Sheets("Sheet1").TextBox1.Text = Sheets("Sheet2").TextBox1.Text
End Sub

thanks

 
You gave scant information regarding your workbook application.

This assumes that 1) the controls are ActiveX controls and 2) the sheet names are Sheet1 & Sheet2 where Sheet has the textbox where the user enters data.

Select the Control in the VB Editor Left-Hand Dropdown. You will see all the events that this control has, including the CHANGE event.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip,

Have you actually tried this code in excel and does it work? I cant get any results no matter what i try.
 
YES! It works!

What kind of control are you using?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I notice that the original code post did not paste as I expected.

In the Sheet2 WORKSHEET OBJECT Code Window...

Private Sub TextBox1_Change()
Sheets("Sheet1").TextBox1.Text = Sheets("Sheet2").TextBox1.Text
End Sub

Make sure that your sheet names are reflected in your code.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
...and it also assumes that your ActiveX textbox controls are actually named TextBox1

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip,

OK, i finally got that to work. i didnt realize that i had to turn on the developer button on my ribbon to get to the active X controls. But here is my problem using that. It doesnt seem like i can hit the enter key in an active x text box and have it return to a new line like i can in a normal text box. this is key because i have users that add comments into 1 text box but they may have several comments to make so they seperate them with a return carriage when hitting the enter key.

any suggestions?

thanks
 
There are properties that control that behavior. Check out Word Wrap, Multi Line and Enter Key Behavior.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
How is ConBo Box? because I need to select Date and time
my Code
'Private Sub ComboBox2_Change()
'With HO Attemp.ComboBox2
' .AddItem "9/13/2012"
' .AddItem "9/14/2012"
'End Sub


Thank alot
 
lotto,

Welcome to Tek-Tips. Please read the Posting Guidelines.

Information that is unrelated to this thread, needs to be posted in a NEW THREAD.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Dear Skip
Thank you for to suggest new user same me now I post to Microsoft: Office Forum
"How to link one text box and one Combo Box from many sheet "
Could you see my problem
Regards
lotto09
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top