Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Is Validation?

Excel 2002, WinXP
I have a number of cells in a range. Some of these cells have Data
Validation, some do not. I'm using a Worksheet_Change macro to pick up on
any changes within this range.
I need to find out if the changed cell has Data Validation or not.
What is the code for that? Thanks for your help. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is Validation?

Otto,

Here is a little function

Function HasValidation(rng As Range)
Dim iType As Long
If rng.Cells.Count 1 Then
HasValidation = "More than 1 cel"
Else
On Error Resume Next
iType = rng.Validation.Type
On Error GoTo 0
HasValidation = iType < 0
End If
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a number of cells in a range. Some of these cells have Data
Validation, some do not. I'm using a Worksheet_Change macro to pick up on
any changes within this range.
I need to find out if the changed cell has Data Validation or not.
What is the code for that? Thanks for your help. Otto




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Is Validation?

Thanks Bob. That works out well for me. Otto
"Bob Phillips" wrote in message
...
Otto,

Here is a little function

Function HasValidation(rng As Range)
Dim iType As Long
If rng.Cells.Count 1 Then
HasValidation = "More than 1 cel"
Else
On Error Resume Next
iType = rng.Validation.Type
On Error GoTo 0
HasValidation = iType < 0
End If
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a number of cells in a range. Some of these cells have Data
Validation, some do not. I'm using a Worksheet_Change macro to pick up
on
any changes within this range.
I need to find out if the changed cell has Data Validation or not.
What is the code for that? Thanks for your help. Otto






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
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


All times are GMT +1. The time now is 02:00 AM.

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

About Us

"It's about Microsoft Excel"