If you are insistent on VBA then here are a couple of examples depending on what you are trying to do.
I will use Ford's formula as an example.
If you simply want to return the value of the formula as if it was on the sheet but it's actually not, then use this code.
Dim x
' This version should return the result of the formula to the variable x.
x = [if('Costing Worksheet'!L3="Closed",0,TODAY()-B3)]
If you want to put the formula into a cell using code, I use cell A1 as an example, then use this code.
' This version will put the formula into cell A1 of the active sheet.
Range("A1").Formula = "=if('Costing Worksheet'!L3=" & Chr(34) & "Closed" & Chr(34) & ",0,TODAY()-B3)"
Bookmarks