PC Review


Reply
Thread Tools Rate Thread

How to check whether Cell has Validation?

 
 
Joe HM
Guest
Posts: n/a
 
      4th Jan 2007
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

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      4th Jan 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Joe HM
Guest
Posts: n/a
 
      4th Jan 2007
Ish ... is that the only way? Oh well ... I guess it works ... thanks!

Joe

On Jan 4, 1:34 pm, "Bob Phillips" <bob....@xxxx.com> wrote:
> 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" <unixve...@yahoo.com> wrote in messagenews:(E-Mail Removed)...
>
>
>
> > 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- Hide quoted text -- Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation -> Validation list is larger than the cell width Barb Reinhardt Microsoft Excel Programming 1 4th Mar 2010 08:24 PM
Check Box and Validation of a cell leerem Microsoft Excel Misc 2 27th Feb 2010 01:49 AM
Validation Data using Validation Table cell range..... =?Utf-8?B?RGVybW90?= Microsoft Excel Misc 16 5th Jan 2010 09:35 PM
Custom Column Validation or DataGrid Cell Validation Stanislav Nedelchev Microsoft ADO .NET 0 15th Dec 2005 10:28 AM
data validation to restrict input in cell based on value of cell above that cell NC Microsoft Excel Programming 2 25th Jan 2005 07:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:47 AM.