Help in Overflow error in VBA

Joined
May 12, 2011
Messages
20
Reaction score
0
Hi, please see the following code in VBA

Dim Num_Parts As Integer
Sheets("Sheet1").Activate
Num_Parts = Cells(5, 2)
Worksheets("Sheet2").Activate
For i = 2 To Num_Parts + 1
Cells(i, 8) = Cells(i, 6) * Cells(i, 3)
Cells(i, 9) = Cells(i, 7) * Cells(i, 3)
Cells(i, 10) = Cells(i, 8) + Cells(i, 9)
Cells(i, 11) = Cells(i, 8) / (24 * 3600)
Cells(i, 12) = Cells(i, 9) / (24 * 3600)
Cells(i, 13) = Cells(i, 10) / (24 * 3600)
Next i
when i am running this, i am getting the error overflow...
can you please help me in rectifying the error??
please
thanks a lot :bow:
 
I think the problem is in the variables, ie dimensions. Try to put instead of (24 * 3600) 86400. It should work.

:thumb:
 
Back
Top