Syntax

expression.HasFormula

expression A variable that represents a Range object.

Example

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.

Visual Basic for Applications
Worksheets("Sheet1").Activate Set rr = Application.InputBox( _ prompt:="Select a range on this worksheet", _ Type:=8) If rr.HasFormula = True Then MsgBox "Every cell in the selection contains a formula" End If
All cells in column have formulas? Are formulas part of each cell in a specified range? Detect whether a cell contains a formula? has formula Has Formula Property HasFormula HasFormula Property

See also: