Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Overflow error

I'm frequently getting an overflow error on this line of code

Set FindCell = .Cells.Find(What:=myPattern, _
After:=.Cells(.Cells.Count), _
lookat:=xlWhole, _
searchorder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)


can someone help me figure out why. I've recently moved to Office 2007 and
am seeing it there when I didn't see it in Office 2003.

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Overflow error

depending on what the With statement has, the reference to .cells.count in
xl2007 could be referring to 1048576 * 16384 cells!!
That could account for the overflow. What's the With-statement?


"Barb Reinhardt" wrote in message
...
I'm frequently getting an overflow error on this line of code

Set FindCell = .Cells.Find(What:=myPattern, _
After:=.Cells(.Cells.Count), _
lookat:=xlWhole, _
searchorder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)


can someone help me figure out why. I've recently moved to Office 2007
and
am seeing it there when I didn't see it in Office 2003.

Thanks,
Barb Reinhardt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Overflow error

After:=.Cells(.Cells.Count)

Ambiguous reference. It would be better to use a Range reference here, like
Range("A" & lastRow), assuming you have defined a last row. XL2007 has a
lot of rows.


"Barb Reinhardt" wrote in message
...
I'm frequently getting an overflow error on this line of code

Set FindCell = .Cells.Find(What:=myPattern, _
After:=.Cells(.Cells.Count), _
lookat:=xlWhole, _
searchorder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)


can someone help me figure out why. I've recently moved to Office 2007
and
am seeing it there when I didn't see it in Office 2003.

Thanks,
Barb Reinhardt



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Overflow error

That big worksheet made .cells.count way too big.

I think you'll want to use this in xl2007:
.cells(.cells.countlarge)





Barb Reinhardt wrote:

I'm frequently getting an overflow error on this line of code

Set FindCell = .Cells.Find(What:=myPattern, _
After:=.Cells(.Cells.Count), _
lookat:=xlWhole, _
searchorder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)


can someone help me figure out why. I've recently moved to Office 2007 and
am seeing it there when I didn't see it in Office 2003.

Thanks,
Barb Reinhardt


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
overflow error Brad Excel Programming 4 April 2nd 09 10:39 PM
Overflow error.. why? Fingerjob Excel Discussion (Misc queries) 4 November 13th 06 05:18 PM
Overflow error Grd Excel Programming 1 January 21st 06 08:13 AM
Overflow Error DG Excel Programming 3 April 15th 05 05:45 PM
Help! Overflow Error 6 Gauthier Excel Programming 6 September 24th 04 12:57 PM


All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"