kskinne
Well-known Member
- Joined
- Feb 17, 2002
- Messages
- 1,267
- Office Version
- 365
- Platform
- Windows
when i run the following macro:
i get the error message "Run-time error '6': Overflow"
when it hits the line:
the range of data i am running this macro on is about 20,000 rows of data that is pulled from an access database using a query. the code is erroring out on about row #11,802
anyone know how to avoid this?
thanks,
kevin
Code:
Sub test()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
LastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
For i = 9 To LastRow
Cells(i, 4).Value = Cells(i, 5).Value / Cells(i, 3).Value
Next i
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
when it hits the line:
Code:
Cells(i, 4).Value = Cells(i, 5).Value / Cells(i, 3).Value
the range of data i am running this macro on is about 20,000 rows of data that is pulled from an access database using a query. the code is erroring out on about row #11,802
anyone know how to avoid this?
thanks,
kevin