I used the following to transfer data from one text box on one worksheet to a different text box on another worksheet. It worked the 1st time, but returned an error of RunTime#13: Type Mismatch
Can anyone help me with a work-around or how to fix it? Microsoft said to do a service patch 3 update, and it definitely did not fix the issue.
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
Bookmarks