Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.56 KB

Excel.ListDataFormat.DefaultValue.md

File metadata and controls

56 lines (35 loc) · 1.56 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ListDataFormat.DefaultValue property (Excel)
vbaxl10.chm758076
vbaxl10.chm758076
Excel.ListDataFormat.DefaultValue
503de2f7-878e-a946-9138-10922082bc0d
04/30/2019
medium

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

[!includeSupport and feedback]