LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Testing for validation property

I would like to test if a cell is validated using a list. However,
the Validation property does not exist by default - it seems that only
validated cells have this property. The code below, therefore,
results in a "Application-defined or object-defined error" when you
change the value of a non-validated cell. I would be grateful to
know what the best way to run this test is. I guess you could use 'On
Error', although this seems hacky.

Many thanks

Jon


Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Validation.Type = xlValidateList Then
MsgBox "Do something"
End If




End Sub
 
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
Modify the IgnoreBlank property of the Validation object susiew32 Excel Programming 4 January 8th 08 07:24 PM
Range Validation property not working w/ Protected worksheet KES[_2_] Excel Programming 0 October 3rd 07 05:54 AM
Validation Testing through list Matt Pierringer Excel Programming 7 March 14th 07 12:26 PM
Formula1 Property of Validation Object to refer to function name [email protected] Excel Programming 2 March 30th 06 12:53 AM
Testing for Cell Validation djrforb Excel Programming 5 September 30th 04 11:55 PM


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