Share via


Range.Value Property

Returns or sets the value of the specified range.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property Value ( _
    RangeValueDataType As Object _
) As Object
    Get
    Set
'Usage
Dim instance As Range
Dim RangeValueDataType As Object
Dim value As Object

value = instance.Value(RangeValueDataType)

instance.Value(RangeValueDataType) = value
Object this[
    Object RangeValueDataType
] { get; set; }

Parameters

  • RangeValueDataType
    Type: System.Object

    Optional Object. The range value data type. Can be one of the following XlRangeValueDataType constants:

    • xlRangeValueDefaultdefault If the specified Range object is empty, 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).

    • xlRangeValueMSPersistXML Returns the recordset representation of the specified Range object in an XML format.

    • xlRangeValueXMLSpreadsheet Returns the values, formatting, formulas, and names of the specified Range object in the XML Spreadsheet format.

Property Value

Type: System.Object

Remarks

When setting a range of cells with the contents of an XML spreadsheet file, only values of the first sheet in the workbook are used. You cannot set or get a noncontiguous range of cells in the XML spreadsheet format.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace