I have this code to enter a formula into a cell:
Dim lcell As String
Dim rng as range
lcell = Sheets("Estimates").Range("estdbcboxlnkcell").Offset(estnum,
0).Address
rng.FormulaR1C1 = "=if(" & lcell & ",RC[-2],0)"
I get an error message when it is run. What am I doing wrong?
Thanks
Dave Peterson - 19 Mar 2008 00:43 GMT
.Address returns the address in A1 reference style. You want to use R1C1
reference style.
lcell = Sheets("Estimates").Range("estdbcboxlnkcell") _
.Offset(estnum, 0).Address(ReferenceStyle:=xlR1C1)
> I have this code to enter a formula into a cell:
>
[quoted text clipped - 6 lines]
> I get an error message when it is run. What am I doing wrong?
> Thanks

Signature
Dave Peterson
ranswert - 19 Mar 2008 01:01 GMT
Worked great
Thanks You
> ..Address returns the address in A1 reference style. You want to use R1C1
> reference style.
[quoted text clipped - 12 lines]
> > I get an error message when it is run. What am I doing wrong?
> > Thanks