Dec 01 2021 05:37 AM
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 able to find a way to fix this and this is needed to help error check >20 users input in their downtime tracking sheets.
Current formula setting works as below:
' Reset Time Gap Formula
Range("F2").Formula = "=$E2-$D2"
Goal - i want to change the "=$E2-$D2" to =IF(COUNTBLANK($B2:$D2)>0,"Recheck Entries, Data Missing",$E2-$D2).
Any version of the error checking formula is unfortunately throwing errors in VBA. Any syntax help would be greatly appreciated!
Dec 01 2021 05:50 AM
Quotes within a quoted string must be doubled:
Range("F2").Formula = "=IF(COUNTBLANK($B2:$D2)>0,""Recheck Entries, Data Missing"",$E2-$D2)"
Dec 01 2021 06:09 AM