I'm getting the old 'type mismatch' error at this line:
the variable txt is a large block of text in a Userform textbox. It is exactly the same as the sheet cell value.
the error and the variable text images below. I'm using the FIND method to find this same value in the sheet in order to update
the cell with changes made from the textbox. Standard process, yet not working.
Any idea why this is not working ?
Thanks for anyone's help.
cr
Code:
Private Sub cmdFINDVAL_Click()
Dim ws As Worksheet
Dim rng As Range
Dim txt As String
Set ws = Worksheets("PROPHLINKS") 'change to your worksheet name
txt = Me.TextBox1.Text 'change to your textbox name
Set rng = ws.Cells.FIND(What:=txt) ---> type mismatch error at this line
If Not rng Is Nothing Then
MsgBox "Found " & txt & " in cell " & rng.Address
Else
MsgBox txt & " not found in " & ws.Name
End If
the variable txt is a large block of text in a Userform textbox. It is exactly the same as the sheet cell value.
the error and the variable text images below. I'm using the FIND method to find this same value in the sheet in order to update
the cell with changes made from the textbox. Standard process, yet not working.
Any idea why this is not working ?
Thanks for anyone's help.
cr