Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Check cells for validation list

Validation is associated with individual cells. Do you want the IF to detect
if ANY cell in the range has validation or if ALL the cells in the range have
validation applied?
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Tried to post this earlier but it didn't seem to arrive??

How do I check for validation list in a range

Roughly:-

If Range("C30:K30,C36:K36") has validation then

*****Code******
Else

*****Code******
End If

Thanks
Sandy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Check cells for validation list

Detecting if any in a range would be good
sandy

"Gary''s Student" wrote in message
...
Validation is associated with individual cells. Do you want the IF to
detect
if ANY cell in the range has validation or if ALL the cells in the range
have
validation applied?
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Tried to post this earlier but it didn't seem to arrive??

How do I check for validation list in a range

Roughly:-

If Range("C30:K30,C36:K36") has validation then

*****Code******
Else

*****Code******
End If

Thanks
Sandy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Check cells for validation list

Sub sandy()
' gsnuxx
x = 9999
Set r = Range("C30:K30", "C36:K36")
For Each rr In r
On Error Resume Next
x = rr.Validation.Type
If x < 9999 Then
MsgBox ("validation found in: " & rr.Address)
Exit Sub
End If
Next
MsgBox ("No validation found")
End Sub

This routine examines the range. If no validation is found, a message is
issued. If validation is found, the address of the first cell with
validation is output in a message.
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Detecting if any in a range would be good
sandy

"Gary''s Student" wrote in message
...
Validation is associated with individual cells. Do you want the IF to
detect
if ANY cell in the range has validation or if ALL the cells in the range
have
validation applied?
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Tried to post this earlier but it didn't seem to arrive??

How do I check for validation list in a range

Roughly:-

If Range("C30:K30,C36:K36") has validation then

*****Code******
Else

*****Code******
End If

Thanks
Sandy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Check cells for validation list

You are welcome.

Another approach is to create a range of validation cells using SpecialCells
and see if it intersects with the range of interest.
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Gary''s Student
Thank you very much
Sandy

"Gary''s Student" wrote in message
...
Sub sandy()
' gsnuxx
x = 9999
Set r = Range("C30:K30", "C36:K36")
For Each rr In r
On Error Resume Next
x = rr.Validation.Type
If x < 9999 Then
MsgBox ("validation found in: " & rr.Address)
Exit Sub
End If
Next
MsgBox ("No validation found")
End Sub

This routine examines the range. If no validation is found, a message is
issued. If validation is found, the address of the first cell with
validation is output in a message.
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Detecting if any in a range would be good
sandy

"Gary''s Student" wrote in
message
...
Validation is associated with individual cells. Do you want the IF to
detect
if ANY cell in the range has validation or if ALL the cells in the
range
have
validation applied?
--
Gary''s Student - gsnu200796


"Sandy" wrote:

Tried to post this earlier but it didn't seem to arrive??

How do I check for validation list in a range

Roughly:-

If Range("C30:K30,C36:K36") has validation then

*****Code******
Else

*****Code******
End If

Thanks
Sandy

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
Reset Validation cells to first list value FirstVette52 Excel Discussion (Misc queries) 6 February 1st 09 04:57 PM
Protect List Validation Cells Kenny Excel Discussion (Misc queries) 3 October 2nd 07 06:48 AM
Remove empty cells from named list / validation list Sp00k Excel Worksheet Functions 4 April 28th 06 03:45 PM
Empty Cells in validation List Jasper Excel Worksheet Functions 1 January 28th 05 01:09 PM
how to list all validation cells on a sheet HCS Excel Programming 4 October 14th 04 06:44 PM


All times are GMT +1. The time now is 03:04 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"