This approach can be a little finicky since you have to build the formula string
1. with the double quotes inside a VBA string to represent a 'quote as an embedded character'
2. and there are some 'empty string' double quotes in the formula
So I usually make it easier for me by using the Q = Chr(34) method
I like it since there's no looping required
Option Explicit
Sub test()
Dim sFormula As String, Q As String, QQ As String
Q = Chr(34)
QQ = Chr(34) & Chr(34)
With ActiveSheet.Columns(1).SpecialCells(xlCellTypeConstants)
s = "IF(" & .Address & "<>" & QQ & "," & _
Q & "L " & Q & "&" & .Address & " ," & _
QQ & ")"
.Value = Application.Evaluate(s)
End With
End Sub
The .Evaluate method I learned about here a long time ago, but I forgot the originator