ListDataFormat.DefaultValue property (Excel)

Returns Variant representing the default data type value for a new row in a column. The Nothing object is returned when the schema does not specify a default value. Read-only Variant.

Syntax

expression.DefaultValue

expression A variable that represents a ListDataFormat object.

Remarks

This property is used only for tables linked to a Microsoft SharePoint Foundation site.

In Excel, you cannot set any of the properties associated with the ListDataFormat object. However, you can set these properties by modifying the list on the SharePoint site.

Example

The following example displays the setting of the DefaultValue property for the third column of the table on Sheet1 of the active workbook. This code requires a list linked to a SharePoint site.

Sub ShowDefaultSetting() 
 Dim wrksht As Worksheet 
 Dim objListCol As ListColumn 
 
 Set wrksht = ActiveWorkbook.Worksheets("Sheet1") 
 Set objListCol = wrksht.ListObjects(1).ListColumns(3) 
 
 If IsNull(objListCol.ListDataFormat.DefaultValue) Then 
 MsgBox "No default value specified." 
 Else 
 MsgBox objListCol.ListDataFormat.DefaultValue 
 End If 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.