Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application-defined or object-defined error
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application-defined or object-defined error
That was it! I was using the wrong variable... should have been j instead of
i. Thanks "Jacob Skaria" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Application-Defined or object defined error 1004 When ran on exel97 but not 2003 | Excel Programming | |||
Copying A Range of Cells From one Sheet to Another - Error Application Defined or Object Defined | Excel Programming | |||
Runtime error 1004- application defined or object defined erro | Excel Programming | |||
Runtime error 1004- application defined or object defined erro | Excel Programming |