View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Determine if a cell has datavalidation

Sub testit()
Dim blnHasValidation As Boolean

On Error GoTo e
blnHasValidation = False
With ActiveCell.Validation: blnHasValidation = CBool(.Type = 0 Or .Type
< 0): End With
e: On Error GoTo 0

MsgBox blnHasValidation
End Sub


"mohsinb" wrote in message
...
Hi,

Is there anyway to determine if the cell has data validation defined ?.
Something similar to range.hasformula. I want to turn incelldropdown to
false if datavalidation is defined for the cell. I need this done to
prevent selection from the dropdown list of protected , locked cells
when the file has been opened in readonly.

Thank you.


---
Message posted from http://www.ExcelForum.com/