Application-defined or object-defined error

B

Bishop

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?
 
J

Jacob Skaria

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

If this post helps click Yes
 
B

Bishop

That was it! I was using the wrong variable... should have been j instead of
i.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top