Check if cell has data validation with VBA

Check if cell has data validation with VBA:

checking  if the cells in excel has data validation or not.

for checking the data validation here is the excel macro. 

 

Sub test()
    On Error Resume Next
        If ActiveCell.SpecialCells(xlCellTypeSameValidation).Cells.Count < 1 Then
            MsgBox "Active Cell does not have validation"
        Else
            MsgBox "Active cell has Validation"
        End If
    On Error GoTo 0
End Sub
 

 
Previous
Next Post »

1 comments:

Click here for comments
Shady Mohsen
admin
18 October 2016 at 08:27 ×

Thanks a lot. This worked for me

Congrats bro Shady Mohsen you got PERTAMAX...! hehehehe...
Reply
avatar