Excel VBA – How to check if a Cell contains Formula

Sub CheckContainFormula()

    If Range("E6").HasFormula Then
        Debug.Print "Yes"
    Else
        Debug.Print "No"
    End If
    
End Sub