EnigmaMatter
asked on
Excel VBA OVERFLOW ERROR
Hello,
I am receiving an error on the first line of:
It used to work, but doesn't work now, and I haven't changed anything that I know of. All it is supposed to do is delete rows where the sum of certain cells is 0, for all cells in the UsedRange.
DOes anyone know of another way to accomplish that or how to fix the above?
I am receiving an error on the first line of:
For INTROW = ActiveSheet.UsedRange.Rows.Count To 6 Step -1
With ActiveSheet
If .Cells(INTROW, 2) + .Cells(INTROW, 4) + .Cells(INTROW, 6) + .Cells(INTROW, 8) + .Cells(INTROW, 10) + .Cells(INTROW, 12) = 0 Then .Rows(INTROW).Delete
End With
Next INTROW
It used to work, but doesn't work now, and I haven't changed anything that I know of. All it is supposed to do is delete rows where the sum of certain cells is 0, for all cells in the UsedRange.
DOes anyone know of another way to accomplish that or how to fix the above?
You probably have
dim INTROW as integer
change it to
dim INTROW as long
dim INTROW as integer
change it to
dim INTROW as long
I think the data size has recently exceeded 32K rows which is why the error never happened before
ASKER
Hello,
The workbook has always been a .xlsb, and the UsedRange is usually around 50 rows, and ususally never more than a 1000.
When I change to Long, it freezes up.
The workbook has always been a .xlsb, and the UsedRange is usually around 50 rows, and ususally never more than a 1000.
When I change to Long, it freezes up.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah! It took me to blank rows, quite a ways down. I "deleted" the blank rows and now it works. Thanks! Works with Integer and Long.
Kevin