Forum Discussion
JoeCavasin
Dec 01, 2021Brass Contributor
Excel VBA - adding formula to specific cell
Morning All. I'm encountering errors for "expected end of statement" when i try to use VBA to add a specific formula to a specific cell. Can anyone advise the appropriate syntax? I haven't been ab...
HansVogelaar
Dec 01, 2021MVP
Quotes within a quoted string must be doubled:
Range("F2").Formula = "=IF(COUNTBLANK($B2:$D2)>0,""Recheck Entries, Data Missing"",$E2-$D2)"
JoeCavasin
Dec 01, 2021Brass Contributor
Thanks Hans! I knew it would be a simply stupid mistake, always is.
Cheers!
Cheers!