Forum Discussion
FatManFluff
Nov 09, 2024Brass Contributor
VBA to add IF Statement
Good morning all, Having a hard time getting VBA to set a formula into a cell when I use the reset button to delete all contents. Currently I am using: Sub AddFormula() Range("P4").Value = "IF(...
- Nov 09, 2024
Try this:
Sub AddFormula() Range("P4").Formula= "=IF(D4<>"""",D4,"""")" End Sub
HansVogelaar
Nov 09, 2024MVP
Try this:
Sub AddFormula()
Range("P4").Formula= "=IF(D4<>"""",D4,"""")"
End Sub
FatManFluff
Nov 09, 2024Brass Contributor
Perfect this worked!! I was so close yet so far! Appreciate the quick reply have a good weekend