View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default Determine if a cell has datavalidation

I think this might be another way:

Function HasValidation(rng As Range) As Boolean
On Error Resume Next
HasValidation = rng.Validation.AlertStyle
End Function

Debug.Print HasValidation(ActiveCell)
Debug.Print HasValidation(Range("B1"))

--
Dana DeLouis
= = = = = = = = = = = = = = = = =


"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.