View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default How to check whether Cell has Validation?

On Error Resume Next
dv = ActiveCell.Validation.Formula1
On Error GoTo 0
MsgBox Not IsEmpty(dv)


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Joe HM" wrote in message
ps.com...
Hello -

I am trying to do a very simple thing: I would like to know whether a
certain cell has a List Validation (i.e. dropdown) turned on.

I get the lSheet.Range().Validation but how does this tell me whether
there is a dropdown validation? I cannot check eny of the fields
without getting an error if there is none defined?

I tried lSheet.Range().Validation.Type = xlValidateList but that does
not work if there is no validation.

Any ideas?

Thanks,
Joe