Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
svb svb is offline
external usenet poster
 
Posts: 6
Default detect validation list

I have a form that contains a listbox of items. When an item is
double-clicked a row of values is entered at the next available row in the
worksheet. Some of the cells in the newly appended row contain validation
lists. I have various types of lists and in some cases when an item is
selected from a list I need to dynamically create a corresponding validation
list in the cell to the right of it. I can do this bit. The problem I have is
that I need to detect whether the current cell contains a validation list as
not all cells will be validation lists. The code will be in the
Worksheet_Change event. I have looked at the Target argument and
Target.Validation, but cannot find a property to give me the info I need. Any
help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default detect validation list

If the cell's validation type is 3 it has a validation list. And the list's
address is returned with Validation.Formula1.

--
Jim
"svb" wrote in message
...
|I have a form that contains a listbox of items. When an item is
| double-clicked a row of values is entered at the next available row in the
| worksheet. Some of the cells in the newly appended row contain validation
| lists. I have various types of lists and in some cases when an item is
| selected from a list I need to dynamically create a corresponding
validation
| list in the cell to the right of it. I can do this bit. The problem I have
is
| that I need to detect whether the current cell contains a validation list
as
| not all cells will be validation lists. The code will be in the
| Worksheet_Change event. I have looked at the Target argument and
| Target.Validation, but cannot find a property to give me the info I need.
Any
| help would be greatly appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
svb svb is offline
external usenet poster
 
Posts: 6
Default detect validation list

Thanks Jim, that will do nicely. The only point I have is that If I do
something like,

If Target.Validation.Type = 3 Then
'// and do some stuff
End If

and the cell I change does not have a validation, which will happen as not
all cells have lists, then I receive an application error. This is not a
problem though as I can trap the error and continue.

"Jim Rech" wrote:

If the cell's validation type is 3 it has a validation list. And the list's
address is returned with Validation.Formula1.

--
Jim
"svb" wrote in message
...
|I have a form that contains a listbox of items. When an item is
| double-clicked a row of values is entered at the next available row in the
| worksheet. Some of the cells in the newly appended row contain validation
| lists. I have various types of lists and in some cases when an item is
| selected from a list I need to dynamically create a corresponding
validation
| list in the cell to the right of it. I can do this bit. The problem I have
is
| that I need to detect whether the current cell contains a validation list
as
| not all cells will be validation lists. The code will be in the
| Worksheet_Change event. I have looked at the Target argument and
| Target.Validation, but cannot find a property to give me the info I need.
Any
| help would be greatly appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default detect validation list

then I receive an application error

Right. Kind of ugly for Excel to blow on things like this but, as you say,
you can trap it.

--
Jim
"svb" wrote in message
...
| Thanks Jim, that will do nicely. The only point I have is that If I do
| something like,
|
| If Target.Validation.Type = 3 Then
| '// and do some stuff
| End If
|
| and the cell I change does not have a validation, which will happen as not
| all cells have lists, then I receive an application error. This is not a
| problem though as I can trap the error and continue.
|
| "Jim Rech" wrote:
|
| If the cell's validation type is 3 it has a validation list. And the
list's
| address is returned with Validation.Formula1.
|
| --
| Jim
| "svb" wrote in message
| ...
| |I have a form that contains a listbox of items. When an item is
| | double-clicked a row of values is entered at the next available row in
the
| | worksheet. Some of the cells in the newly appended row contain
validation
| | lists. I have various types of lists and in some cases when an item is
| | selected from a list I need to dynamically create a corresponding
| validation
| | list in the cell to the right of it. I can do this bit. The problem I
have
| is
| | that I need to detect whether the current cell contains a validation
list
| as
| | not all cells will be validation lists. The code will be in the
| | Worksheet_Change event. I have looked at the Target argument and
| | Target.Validation, but cannot find a property to give me the info I
need.
| Any
| | help would be greatly appreciated.
|
|
|


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 Discussion (Misc queries) 0 November 7th 06 12:54 PM
Detect tabular list in VBA quartz[_2_] Excel Programming 3 September 22nd 06 07:39 PM
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 06:48 PM.

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"