Error 1004 on VBA operation
Hello, folks. I'm getting an error : "Run-time error '1004':
Application-defined or object-defined error" when I get to the
following line:
Set ActualsActualsRange = ActiveWorkbook.Worksheets("Actuals-
Sheet").Range(Cells(5, 12), Cells(5, 500))
Any idea what's wrong with this? It looks like a properly-formed
range, and pretty explicitly referenced.
Which version of Excel are you running? I use Excel 2003 and there are
only
256 columns in a worksheet, so I get that error because a range with a
cell
in column 500 at its bottom right corner is impossible. But perhaps you're
using Excel 2007 and that might have enough columns on a worksheet, in
which
case it's something else that's causing the problem...
I'm in 2007, so the address should be ok. Thanks for the info though!
I'll have to be careful if I export it to the old format.
If I change the 500 to 256 or less it works for me, so I guess it should
work for you in Excel 2007 at 500.
|