Run Time Error 6: Overflow

rosiemac

New Member
Joined
Mar 26, 2009
Messages
21
Hi,

I have received a Run Time Error when executing some code. The code tries to define a new row
e.g.
rowa= rowb+1
rowb=rowa+1
The code is part of a loop and works fine until it reaches row 32763.
The runtime error suggests that excel has run out of rows. When I click Debug, the "rowb = rowa+1" is highlighted.

I thought excel had 65000+ rows. Indeed on the same worksheet that is causing me problems, I can navigate down to 65000 rows without any problem.

Any thoughts on what is causing this problem? :confused:

Thank you in advance.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi Rosie

I found this when I had a similar problem,

You must declare "x" as a long data type.
For example:

Dim x as integer
x = len(longstring) 'Longstring is a string over 32,768 characters in
length


Would cause an overflow error

Dim x as long
x = len(longstring) 'Longstring is a string over 32,768 characters in
length

Would work


The integer data type only allows values from -32,768 to 32,768. More
or less than that and you get an overflow error.
 
Upvote 0

Forum statistics

Threads
1,202,977
Messages
6,052,890
Members
444,608
Latest member
Krunal_Shah

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top