Value Property

Applies To

Application object, Borders Collection object, ControlFormat object, Name object, Parameter object, PivotField object, PivotFormula object, PivotItem object, PivotTable object, Range object, Style object, Validation object.

Description

The meaning of the Value property depends on the object to which it is applied, as shown in the following table.

Object

Value

Application

Always returns "Microsoft Excel." Read-only.

Borders

Synonym for Borders.LineStyle.

Name

A string containing the formula that the name is defined to refer to. The string is in A1-style notation in the language of the macro, and it begins with an equal sign. Read-only.

Parameter

The parameter value. For more information, see the Parameter object.

PivotField

The name of the specified field in the PivotTable.

PivotItem

The name of the specified item in the PivotTable field.

PivotTable

The name of the PivotTable.

Range

The value of the specified cell. If the cell is empty, Value returns the value Empty (use the IsEmpty function to test for this case). If the Range object contains more than one cell, returns an array of values (use the IsArray function to test for this case).

Style

The name of the specified style.

Validation

True if all the validation criteria are met (that is, if the range contains valid data).


See Also

LineStyle property, MultiSelect property.

Example

This example sets the value of cell A1 on Sheet1 to 3.14159.

Worksheets("Sheet1").Range("A1").Value = 3.14159
This example loops on cells A1:D10 on Sheet1. If one of the cells has a value less than 0.001, the code replaces the value with 0 (zero).

For Each c in Worksheets("Sheet1").Range("A1:D10")
    If c.Value < .001 Then
        c.Value = 0
    End If
Next c