Excelpromax123
Board Regular
- Joined
- Sep 2, 2021
- Messages
- 172
- Office Version
- 2010
- Platform
- Windows
Hello everyone on the Forum. I'm using the code below to filter an area with about 800,000 lines, but the code reports a memory full error as shown. I tried 500,000 and it didn't work. Please advise how to fix the error. Sincerely thank !
Data excel
VBA Code:
Sub test()
Dim sArr(), dArr(), Dk1 As String, I As Long, K As Long, R As Long, Col As Long, a As Long
a = 700000
sArr = Range("A1:S" & a).Value
R = UBound(sArr)
ReDim dArr(1 To R, 1 To 19)
For I = 1 To R
If sArr(I, 6) = 3 Then
K = K + 1
For Col = 1 To 19
dArr(K, Col) = sArr(I, Col)
Next Col
End If
Next I
Range("V1:AN1000000").ClearContents
Range("V1").Resize(K, 19) = dArr
End Sub
Data excel
test loc VBA.xlsm
drive.google.com