posted July 24, 2007 13:43
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:
' 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