InvalidData Property

Microsoft Excel Visual Basic

Show All Show All

InvalidData Property

Returns a Boolean value that indicates if a row in a list contains cells that don't pass data validation and need to be fixed before any changes can be committed to the Microsoft Windows SharePoint Services site. Read-only Boolean.

expression.InvalidData

expression    Required. An expression that returns a boolean value.

Example

The following sample code uses the InvalidData property to determine if the first row contains valid data in a list that is linked to a SharePoint site. This sample code requires a list that is connected to a SharePoint site.

    Sub DisplayDataValidation()
    Dim wrksht As Worksheet

    Set wrksht = ActiveWorkbook.Worksheets(1)

    If wrksht.ListObjects(1).ListRows(1).InvalidData = True Then
        MsgBox "There was a problem with the data in the row."
    Else
        MsgBox "The row contains valid data."
    End If
End Sub