VBA Macro crashes after 32000 rows

The VBA ‘Int’ type is a signed 16-bit field so it can only hold values from -32768 to +32767. Change those variables to ‘Long’, which is a signed 32-bit field and can hold values from -2147483648 to +2147483647. Should be enough for Excel. 😉

Leave a Comment