Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

VBA Error

Hi,

I have this code in the VBA Editor

ActiveCell.FormulaR1C1 = "=DATE(YEAR(Update!AB1),MONTH(Update!AB1),0)"

It produces an error in excel, the formula it drops out is

=DATE(YEAR(Update!'AB1'),MONTH(Update!'AB1'),0)

I notice if i take the apostrophes away from AB1, the formula works, how can i fix this in the editor?

Thanks
Seamus
ASKER CERTIFIED SOLUTION
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand 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
SOLUTION
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
Avatar of Seamus2626

ASKER

Thanks guys