Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns a Long value that represents the number of decimal places to show for the numbers in the ListColumn object. Read-only Long.
Syntax
expression.DecimalPlaces
expression A variable that represents a ListDataFormat object.
Remarks
Returns 0 if the Type setting is not appropriate for decimal places. Returns xlAutomatic (-4105 decimal) if the Microsoft SharePoint Foundation site is automatically determining the number of decimal places to show in the SharePoint list.
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 returns the setting of the DecimalPlaces property for the third column of a list on Sheet1 of the active workbook.
Function GetDecimalPlaces() As Long
Dim wrksht As Worksheet
Dim objListCol As ListColumn
Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
Set objListCol = wrksht.ListObjects(1).ListColumns(3)
GetDecimalPlaces = objListCol.ListDataFormat.DecimalPlaces
End Function
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.