Hi! I'm refactoring code from a project I built when I was first learning. The program pulls data from a CSV report that takes a month's worth of data from the database. However, we now need to pull and process a year's worth. The current macro can handle a months worth of data (about 13,000 rows) but a years worth has a little over 160,000 rows (the CSV file is 251 MB). Here is the loop I'm trying to implement:
The error I get reads "There isn't enough memory to complete this action. Try using less data or closing other applications." Initially I was attempting to copy/paste the data to a new tab and figured the clipboard couldn't handle that much memory so that's when I switched to a loop. I had the i variable dimension set to integer at first but changed it to "Long" after realizing my mistake there. However, I'm still getting the same error. Is this too much for Excel to handle or am I missing something? TIA!
VBA Code:
Dim rng As Range, i As Long
'I create a named range here because when I pull reports the amount of data is always different
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Name = "NoClientList"
Set rng = Range("NoClientList")
For i = rng.Rows.Count To 1 Step -1
If rng.Cells(i).Value = "No" Then rng.Cells(i).EntireRow.Delete
Next
The error I get reads "There isn't enough memory to complete this action. Try using less data or closing other applications." Initially I was attempting to copy/paste the data to a new tab and figured the clipboard couldn't handle that much memory so that's when I switched to a loop. I had the i variable dimension set to integer at first but changed it to "Long" after realizing my mistake there. However, I'm still getting the same error. Is this too much for Excel to handle or am I missing something? TIA!