View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Run Time error '1004': Application-defined or object-defined error

Hi

Nothing wrong with the line in question, but I think that the variable rwn
is empty, causing the error.

BTW: Please post the entire code, as it's eaysier to locate the error.

Regards,
Per

"PBcorn" skrev i meddelelsen
...
I have the following line of code* causing the above error:

sht.activate

*sht.Range(Cells(rwn, 3), Cells(rwn, sht.UsedRange.Columns.Count)).Copy

this is within a for-next loop:

For Each sht In ThisWorkbook.Worksheets
next sht

rwn is an integer from a line within a another for-next loop:

rwn = cll.row

why is this causing an error?