Thread: Is Validation?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Is Validation?

Otto,

Here is a little function

Function HasValidation(rng As Range)
Dim iType As Long
If rng.Cells.Count 1 Then
HasValidation = "More than 1 cel"
Else
On Error Resume Next
iType = rng.Validation.Type
On Error GoTo 0
HasValidation = iType < 0
End If
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a number of cells in a range. Some of these cells have Data
Validation, some do not. I'm using a Worksheet_Change macro to pick up on
any changes within this range.
I need to find out if the changed cell has Data Validation or not.
What is the code for that? Thanks for your help. Otto