+ Reply to Thread
Results 1 to 1 of 1

MismatchError: Copy Text to Textbox Using Characters Method

  1. #1
    Registered User
    Join Date
    07-24-2007
    Posts
    2

    Help Using Characters Method

    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
    Last edited by Lace29M; 07-24-2007 at 05:45 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1