View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Neal[_2_] Neal[_2_] is offline
external usenet poster
 
Posts: 10
Default Fatal Error in Excel with one line in a macro

Ronald,

Here is the actual code. I tried the code on another
spreadsheet and it works. Something else is messing up
the original file.

Range("EndDate") = Range("MainDate").End(xlDown)

This works in a different file. EndDate is in one sheet
and MainDate is in another sheet on the same workbook.

Neal


-----Original Message-----
If Range("xyz") is greater than 1 range, than that can

very easily cause a
problem as VBA in this cause is attempting to have the

value of the range =
the value of the cell that has been led to by the End

method on the Range of
("abc"). If you trying to copy and past of what at the

end of the range of
Range("abc") to the range of Range("xyz"), then the

following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I

ran
the macro, I got a fatal error - excel needs to

shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks

in
advance since I do not want to lose the entire file.

Neal



.