View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Application-defined or object-defined error

Check out the value of i . If i-5 is less than 1 it will return error

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

I have the following code:

Worksheets("Fail Stats").Cells(FSStartRow, "A") = Cells(i - 5, "A").Value

I keep getting Application-defined or object-defined error. I also tried:

Worksheets("Fail Stats").Cells(FSStartRow, "A") =
Worksheets(center(i)).Cells(i - 5, "A").Value

But that didn't work either. What am I doing wrong?