Public Function Cell_Has_Data_Validation(RngCell As Range) As String
On Error GoTo Cell_Has_Data_Validation_ErrorHandler
Dim LngCellValidationType As Long
‘====================================================================================================
‘Iff the cell in question is actually not a cell then return a null string and exit
‘====================================================================================================
If TypeName(RngCell) <> “Range” Then
____ Cell_Has_Data_Validation = “”
____ Exit Function
End If
‘====================================================================================================
‘Iff the cell in question is actually NOTHING then return a null string and exit
‘====================================================================================================
If RngCell Is Nothing Then
____ Cell_Has_Data_Validation = “”
____ Exit Function End If
‘====================================================================================================
‘Iff the cell in question actually consists of >1 AREA then return a null string and exit
‘====================================================================================================
If RngCell.Areas.Count <> 1 Then
____ Cell_Has_Data_Validation = “”
____ Exit Function
End If
‘====================================================================================================
‘Iff the cell in question is actually >1 CELLS then return a null string and exit
‘====================================================================================================
If RngCell.Cells.Count <> 1 Then
____ Cell_Has_Data_Validation = “”
____ Exit Function
End If
‘====================================================================================================
‘Determine iff the cell in question has validation, if it does then return “True” else an error will result and thus return “False”
‘====================================================================================================
LngCellValidationType = RngCell.Validation.Type Cell_Has_Data_Validation = “True”
Exit Function
‘====================================================================================================
‘At this juncture an error has occurred and thus return “False”
‘====================================================================================================
Cell_Has_Data_Validation_ErrorHandler:
____ Cell_Has_Data_Validation = “False”
End Function
