View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Validation Object error

Something like this:

Sub AABB()
Dim s As String
Set target = ActiveCell
s = ""
On Error Resume Next
s = target.Validation.Formula1
On Error GoTo 0
If s < "" Then
MsgBox s
Else
MsgBox "No validation"
End If
End Sub


--
Regards,
Tom Ogilvy


"Peter Zinniker" wrote:

I want to read the Formula1 property of a validation object of the cell Target.
Target.Validation.Formula1 produces an "Application-defined or
object-defined error" if Target don't have a validation rule.
How cant I check whether a validation list is defined?