I have about 40K+ lines of "raw data" that I need to analyze. I am only interested in the lines that contain the word "Degraded". I have a macro that searches all lines of raw data and extracts any line containing the word "Degraded" (this macro also unlocks and locks the worksheet). The macro was working fine in the past; however, I am now getting a "Run-time Error '13' Type Mismatch" when I run the macro. It seems to get hung up on the string
"If InStr(v, "Degraded.") > 0 Then"
This is probably because the word "Degraded" is not an integer.
Does anyone know a better way to do this, or other work-arounds.
The full macro is posted below:
Sub Luxation2()
Dim K As Long, r As Range, v As Variant
K = 1
Dim w1 As Worksheet, w2 As Worksheet
Set w1 = Sheets("All Msg")
Set w2 = Sheets("Degraded Msg")
w1.Activate
w2.Unprotect Password:=""
For Each r In Intersect(Range("A:A"), ActiveSheet.UsedRange)
v = r.Value
If InStr(v, "Degraded.") > 0 Then
r.Copy w2.Cells(K, 1)
K = K + 1
End If
Next r
w2.Protect Password:=""
End Sub
Bookmarks