Range.HasFormula Property (Excel)

True if all cells in the range contain formulas; False if none of the cells in the range contains a formula; null otherwise. Read-only Variant .


expression. HasFormula

expression A variable that represents a [Range](./Excel.Range(Graph property).md) object.


This example prompts the user to select a range on Sheet1. If every cell in the selected range contains a formula, the example displays a message.

Set rr = Application.InputBox( _ 
 prompt:="Select a range on this worksheet", _ 
If rr.HasFormula = True Then 
 MsgBox "Every cell in the selection contains a formula" 
End If

See also

Range Object