I have an excel file with rows of more than 300,000, I need a macro code that copies all rows and paste them to a new sheet if any column has SPECIAL TEXT, the sheet has multiple columns from A-N,
I found a code that works on the same principle, but I don't know why It's not working in my case,
code is from this forum by (NORIE).
Please help me with this.
Thanks.
I found a code that works on the same principle, but I don't know why It's not working in my case,
code is from this forum by (NORIE).
VBA Code:
Sub BankMove()
Dim strArray As Variant
Dim wsSource As Worksheet
Dim wsDest As Worksheet
Dim NoRows As Long
Dim DestNoRows As Long
Dim I As Long
Dim J As Integer
Dim rngCells As Range
Dim rngFind As Range
Dim Found As Boolean
strArray = Array("bank", "KLM", "firm")
Set wsSource = ActiveSheet
NoRows = wsSource.Range("A65536").End(xlUp).Row
DestNoRows = 1
Set wsDest = ActiveWorkbook.Worksheets.Add
For I = 1 To NoRows
Set rngCells = wsSource.Range("C" & I & ":F" & I)
Found = False
For J = 0 To UBound(strArray)
Found = Found Or Not (rngCells.Find(strArray(J)) Is Nothing)
Next J
If Found Then
rngCells.EntireRow.Copy wsDest.Range("A" & DestNoRows)
DestNoRows = DestNoRows + 1
End If
Next I
End Sub
Please help me with this.
Thanks.