LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Various error 1004's associated with copying ranges. Excel Gurus please help!!

I have a macro that takes a table of data, typically 8-10 columns and
approx 40,000-60,000 rows, and processes it by adding new columns to
the right of it.

Because of the intensive calculations involved, I do this by copying
formulas one row at a time, calculating, and converting the result to
value before moving on to the next row.

The problem I am having is that for some reason my formulas work well
until they get to row 10925, at which point I get the following error:

Run time error 1004 Application defined or Object Defined error
The statements that generated the error:
' convert formula to value
With ActiveSheet.Range(Cells(lefttop, colfound), Cells(rightbottom,
cc))
.Formula = .Value
End With

I tried these variations as well but got the same error, always at the
same row
ActiveSheet.Range(Cells(lefttop, colfound), Cells(rightbottom,
cc)).value = ActiveSheet.Range(Cells(lefttop, colfound),
Cells(rightbottom, cc)).value
ActiveSheet.Range(Cells(lefttop, colfound), Cells(rightbottom,
cc)).formula = ActiveSheet.Range(Cells(lefttop, colfound),
Cells(rightbottom, cc)).value

Note: Thinking that perhaps there might have been something problematic
about the data in that row, I deleted it but found that it made no
difference.


After spending many hours on these forums unsuccessfully looking for a
solution, I finally removed the statement altogether and re-ran the
macro. This time I got the following error prompted by a statement that
was working just fine previously:

Run time error 1004 Clear method of range class failed
The statement associated with the error:
Worksheets(wrksheet).Range(Cells(lefttop, colfound), Cells(usedrows,
cc)).Clear


And after removing THAT statement in turn, I suddenly get another error
message for a statement that hitherto was working just fine:

Run time error 1004: copy method of range class failed
The statement associated with the error:
ActiveSheet.Range(Cells(formularow, colfound), Cells(formularow,
cc)).Copy ActiveSheet.Range(Cells(lefttop, colfound),
Cells(rightbottom, cc))


I would appreciate any help on this. It has been the source of much
frustration for me and I desperately need this issue fixed to get my
work done. One thing I might mention, also, is that I typically DO NOT
define variables in my code but let excel do that for me.


Thanks!

 
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
Excel Gurus-Please Help! Ginny Excel Discussion (Misc queries) 1 November 1st 07 05:22 PM
OK, a really tricky one now for Excel gurus! tim :/ Excel Discussion (Misc queries) 2 October 25th 05 12:55 PM
Excel VBA Gurus needed Career Capital Excel Discussion (Misc queries) 0 September 9th 05 05:46 AM
Looking for Excel VBA gurus Career Capital Excel Programming 0 September 9th 05 05:29 AM
For the Excel Query Gurus Andrew Excel Worksheet Functions 4 February 25th 05 06:14 AM


All times are GMT +1. The time now is 06:38 AM.

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

About Us

"It's about Microsoft Excel"