Hi All,
I am trying to replicate a formula across the worksheet rather than down as a small part of a macro.
It copies down just fine, so I thought I would replace the xldown with xlToRight.
Sadly I out of my depth now so was hoping someone could show me the next step.
I'm getting an Application Defined or Object Defined Error on this code -
Thanks
Paul
I am trying to replicate a formula across the worksheet rather than down as a small part of a macro.
Code:
Dim rng as Range
set rng = Range(cells(2,1),cells(2,1).End(xlDown))
rng.offset(0,1).Formula = Cells(2,2).Formula
It copies down just fine, so I thought I would replace the xldown with xlToRight.
Code:
Dim rng as Range
set rng = Range(cells(2,1),cells(2,1).End(xlToRight))
rng.offset(0,1).Formula = Cells(2,2).Formula
Sadly I out of my depth now so was hoping someone could show me the next step.
I'm getting an Application Defined or Object Defined Error on this code -
Code:
rng.offset(0,1).Formula = Cells(2,2).Formula
Thanks
Paul