View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default How to know if a validation dropdown exist

For Each cell In Activesheet.UsedRange
If HasValidation(cell) Then
MsgBox cell.Address
End If
Next cell

'-----------------------------------------------------------------
Public Function HasValidation(r As Range) As Boolean
'-----------------------------------------------------------------
Dim i
Dim ma As Range
On Error Resume Next
HasValidation = True
i = r.Validation.Type
If Err.Number < 0 Then
HasValidation = False
Exit Function
End If
Set ma = r.MergeArea
If ma.Cells(1, 1).Address < r.Address Then
HasValidation = False
End If
End Function

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Who I Am" wrote in message
oups.com...
This workbook has many sheets, and some of them have multiple
validation dropdown.

How do I know
1. If a sheet has dropdown(s)?
2. What are their addresses?

Thanks in advance.