Hi
I try using code contains array to deal with big data for each sheet until running code without any slowness, but I face error subscript ou of range in this line
b(k, j) = a(i, j)
the code should delete rows contains BALANCE word in column A for every sheet contains BALANCE word in column A .
Sub deleterows_v2()
Dim sh As Worksheet
Dim a As Variant, b As Variant
Dim i As Long, j As Long, k As Long
For Each sh In Sheets
a = sh.Range("A2:H" & sh.Range("H" & Rows.Count).End(3).Row).Value
ReDim b(1 To UBound(a, 1), 1 To UBound(a, 2))
For i = 1 To UBound(a, 1)
If a(i, 1) <> "BALANCE" Then
k = k + 1
For j = 1 To UBound(a, 2)
b(k, j) = a(i, j)
Next
End If
Next
sh.Range("A1").Resize(UBound(b, 1), UBound(b, 2)).Value = b
Next
End Sub
any chance to correct the code,please?