In an Excel VBA macro I compute seconds per day with Dim secs As Long and secs = 24 * 60 * 60. The result, 86400, fits easily in a Long, yet the line stops with run-time error 6, Overflow. A loop counter declared in Dim i, lastRow As Integer also fails once the sheet passes about 32,000 rows.
Why does the multiplication overflow when the destination is large enough, and what is wrong with my declarations?




