homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » Other Geeky Stuff   » Ask a Geek!   » Excel Help: Using Characters Method to Copy Text to Text Box

 - UBBFriend: Email this page to someone!    
Author Topic: Excel Help: Using Characters Method to Copy Text to Text Box
Lace29M
Single Celled Newbie
Member # 9798

Icon 1 posted July 24, 2007 13:43      Profile for Lace29M     Send New Private Message       Edit/Delete Post   Reply With Quote 
On Worksheet1, I have a text box [ .Shapes("Account") ] for data entry. The data entry into this box can change at any time. Any data filled into this text box drawing needs to be populated into another text box drawing on Worksheet2 [ .Shapes("AssignedAcct") ]. I am not sure if there is a way to copy the data entered or if there is a way to link the two text boxes. Please help! Thank you.

I used the following before, but received a runtime #13-Mismatch Error:

Sub TextBox_To_TextBox()

' Dimension the variables.
Dim x As Integer
Dim txtBox1 As TextBox, txtBox2 As TextBox
Dim theText As String

' Set txtBox1 and txtBox2 equal to the active sheet's TextBox
' objects. Replace the ordinal number with your TextBox names
' in quotes. For example: ActiveSheet.DrawingObjects("Text 1")
Set txtBox1 = Sheets("Account Priorities").Shapes("Manager")
Set txtBox2 = Sheets("Assigned Priorities").Shapes("AssignedManager")

' Create a For-Next construct that loops until there is no more
' text in txtBox1.
For x = 1 To txtBox1.Characters.Count Step 250

' Place the first text box text into a variable called theText.
theText = txtBox1.Characters(start:=x, Length:=250).Text

' Place the value of theText variable into second text box.
txtBox2.Characters(start:=x, Length:=250).Text = theText
Next

End Sub

Posts: 1 | Registered: Jul 2007  |  IP: Logged


All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam