Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default How to check whether Cell has Validation?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default How to check whether Cell has Validation?

Ish ... is that the only way? Oh well ... I guess it works ... thanks!

Joe

On Jan 4, 1:34 pm, "Bob Phillips" 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" wrote in glegroups.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- Hide quoted text -- Show quoted text -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check Box and Validation of a cell leerem Excel Discussion (Misc queries) 2 February 27th 10 01:49 AM
VB Data Validation check Bony Pony[_3_] Excel Discussion (Misc queries) 1 October 8th 09 02:46 PM
Check validation on SelectionChange [email protected] Excel Programming 1 June 29th 06 06:03 PM
Problem with validation check! Neo1 Excel Worksheet Functions 4 March 19th 06 03:28 AM
Check Boxes & Data Validation Mike R Excel Discussion (Misc queries) 4 October 4th 05 06:47 PM


All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"