psbrown
MIS
- Oct 16, 2001
- 40
Hi
I am doing my first excel project and found how to define a range definition from the vba help.
my syntax is:
Worksheets("Chart").Range(Cells(2, 2), Cells(2,
NoCols)).Interior.ColorIndex = 6
Even removing the variable and using a constatnt as below
Worksheets("Chart").Range(Cells(2, 2), Cells(2,
6)).Interior.ColorIndex = 6
It still fails with
run time error 1004
application defined or object defined error
if I change the statement to
.Range("A1").Interior.ColorIndex = 6
it works ok.
Any help appreciated.
Paul
I am doing my first excel project and found how to define a range definition from the vba help.
my syntax is:
Worksheets("Chart").Range(Cells(2, 2), Cells(2,
NoCols)).Interior.ColorIndex = 6
Even removing the variable and using a constatnt as below
Worksheets("Chart").Range(Cells(2, 2), Cells(2,
6)).Interior.ColorIndex = 6
It still fails with
run time error 1004
application defined or object defined error
if I change the statement to
.Range("A1").Interior.ColorIndex = 6
it works ok.
Any help appreciated.
Paul