MaxCharacters Property [Excel 2003 VBA Language Reference]

Returns a Long containing the maximum number of characters allowed in the

Visit ListColumn

object if the

Visit Type

property is set to xlListDataTypeText or xlListDataTypeMultiLineText. Returns -1 for columns whose Type property is set to a non-text value. Read-only Long.

This property is used only for lists that are linked to a SharePoint site.

expression.MaxCharacters

expression Required. An expression that returns a

Visit ListDataFormat

object.

Remarks

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

Example

The following example displays the setting of the MaxCharacters property for the third column of a list in Sheet1 of the active workbook.

   
   Dim wrksht As Worksheet
   Dim objListCol As ListColumn
   
   Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
   Set objListCol = wrksht.ListObjects(1).ListColumns(3)

   Debug.Print objListCol.ListDataFormat.MaxCharacters

Applies to | ListDataFormat Object