VBA Run Time Errors
Run-time error '6': Overflow
Why doesn't this work?
The Integer data type is a 16-bit signed integer with a maximum value of 32,767; assigning it to anything larger than that will overflow the type and raise this error.
Why does this work?
By using a Long (32-bit) integer instead, we can now make a loop that iterates more than 32,767 times without overflowing the counter variable's type.
See Data Types and Limits for more information.