runtime error '6' overflow

D

don

I get a runtime error in a routine that has run many times in the
past.
The difference is each month I have more data.
the routine does a sort then stops at this line:

finalrow=cells(rows.count,"a").end(xlup).row

The answer should be 41236.
If I comment out this line and simply put in

finalrow=41236

I still get the runtime error '6'

If I put this line in a temp subroutine is runs fine.

Not sure what to do next.

Thanks for any help.

Don
 
D

Dave Peterson

Did you use:

Dim FinalRow as Integer

If yes, change it to:
dim finalrow as long

Integers can only go up to 32767.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Runtime error R6034 0
Runtime Error 6 Overflow 1
Macro Runtime errors 8
Ignoring a runtime error 1
Runtime Error 1004 1
Overflow Error 4
Runtime Error 6 - Overflow 17
runtime error 9 subscript out of range 1

Top