Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 449

VBA: worksheet row overflow error 'Run-time error '6' Overflow using worksheets().Range

$
0
0

I have a vba program that is filling a sheet with the results of a simulation. One line of code is:

Dim RunCounter As IntegerDim Margin (250,000, 5) as VariantWorksheets("Optimization").Range("s", & RunCounter + 2) = Margin(Runcounter, 0)

When RunCounter gets to a value of 32766 so the row total is 32768, I get an overflow error

Run-time error '6': Overflow

I am not sure why I am getting this since excel allows many more rows.

Any ideas?

I don't know what to try. Since Worksheets is not dimensioned, I am not sure what to do


Viewing all articles
Browse latest Browse all 449

Trending Articles