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:
 
Joined
May 11, 2011
Messages
14
Reaction score
0
I think the problem is in the variables, ie dimensions. Try to put instead of (24 * 3600) 86400. It should work.

:thumb:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top