Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
Data validation with validation lists and combo boxs | Excel Discussion (Misc queries) | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming |