Link to home
Start Free TrialLog in
Avatar of rrhandle8
rrhandle8Flag for United States of America

asked on

Paste Excel Formula With VBA

I am trying to paste this formula into a cell.

Cells(2, C).Formula = "=if($ES!RC[223]<>0,1,0)"

I get the following error.

Run-time error '1004':
Application-defined or object-defined error
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It is accepting C to be an undeclared variable but when used it does not know what it is.

Instead use Cells(2,3)= "what ever you want here"
Alternatively use Range("C2")= "what ever you want here"