The overflow is happening because Integer's are not large enough for the total rows on a sheet. Use a larger number type instead. Also the Row was a mistake, that q variable can be a Long too as the line where it is populated returns a number.
Dim i As Long, j As Long, p As Long, q As Long
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|