Hi,
I am new to this forum and am having trouble with a type mismatch on the Range.Find function.
It is finding a link in the text it is searching and giving me a type mismatch.
Here is my code :
PS: Some values have been changed for copyright of internal office purposes, but other than that this is the code I am running. The error only appears when I search a range that contains an extra long link...
I am new to this forum and am having trouble with a type mismatch on the Range.Find function.
It is finding a link in the text it is searching and giving me a type mismatch.
Here is my code :
Code:
Dim SearchSheet As Worksheet
Set SearchSheet = ThisWorkbook.Worksheets("Ticket Finder")
Dim txt As String
Dim i As Integer
Dim CellRange As Integer
Dim FullText As Variant
Dim out As Variant 'String
Dim OutCell As Integer
Dim DupeRange As Integer
Dim OutSheet As Worksheet
Dim xl0 As New Excel.Application
Dim xlw As New Excel.Workbook
OutCell = 2
''File Open/Close Operations
Set xlw = xl0.Workbooks.Open("name of output file")
Set OutSheet = xlw.Worksheets("Sheet1")
For CellRange = 2 To 2000
'If CDate(SearchSheet.Range("F" & CellRange).Value) > CDate("12/22 5:00 AM") Then
txt = SearchSheet.Range("V" & CellRange)
FullText = Split(txt, " ")
For i = 0 To UBound(FullText)
out = FullText(i)
With OutSheet.Range("A1:A2000")
Set C = .Find(out, LookIn:=xlValues)
Set SearchSheet = ThisWorkbook.Worksheets("Ticket Finder")
If Not C Is Nothing Then
If SearchSheet.Range("M" & CellRange).Value = "Model#" Then
xlw.Worksheets("Sheet1").Range("B" & C.Row).Value = xlw.Worksheets("Sheet1").Range("B" & C.Row).Value + 1
End If
End If
If C Is Nothing Then
If SearchSheet.Range("M" & CellRange).Value = "Model#" Then
xlw.Worksheets("Sheet1").Range("A" & OutCell).Value = out
xlw.Worksheets("Sheet1").Range("B" & OutCell).Value = 1
OutCell = OutCell + 1
End If
End If
End With
Next i
'End If
Next CellRange
xlw.Save
xlw.Close
PS: Some values have been changed for copyright of internal office purposes, but other than that this is the code I am running. The error only appears when I search a range that contains an extra long link...