Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50068

Need help with error

$
0
0
I'm trying to set a cell value to an address but I get a "Run-time error '1004': Application-defined or object-defined error".

Here is the line that is causing the error

Code:

Range("L5").Value = "=('Work Hours Data'!" & Sheet7.Range("A1").Offset(2, x + 6).Address
now if I take out the first parenthesis and it looks like

Code:

Range("L5").Value = "='Work Hours Data'!" & Sheet7.Range("A1").Offset(2, x + 6).Address
it just returns the value of the cell and not the address of the cell, which is what I am looking for.

I tried doing Range("L5").Formula instead of Range("L5").Value but it does the same thing. Any ideas?

Viewing all articles
Browse latest Browse all 50068

Trending Articles