April 2006
Beginner
1114 pages
98h 16m
English
listrow.InvalidData
Returns True if the row contains data that is not valid as per the list schema. Returns False if the row contains only valid data. The following code highlights rows in lists that contain invalid data:
Sub HighlightInvalidRows( )
Dim ws As Worksheet, lst As ListObject, row As ListRow
Set ws = ActiveSheet
Set lst = ws.ListObjects("Test List")
For Each row In lst.ListRows
If row.InvalidData Then
row.Range.Font.Color = RGB(255, 0, 0)
Else
row.Range.Font.Color = RGB(0, 0, 0)
End If
Next
End SubExcel validates list entries as the user enters data, so it is unlikely that invalid data is the result of user edits. However, entries made by code are not automatically validated.
Read now
Unlock full access