10101
10101

Reputation: 2402

Excel VBA validate any value

I am wondering is there a way to xlValidateAnyValue? I have made a userform for inputting comment in a Validation box. So basically I don't need any certain validation but just comment. I know how to create a comment but I would like to do it validation way.

Private Sub CommandButton25_Click()
With ActiveCell.Validation
 .Add Type:=xlValidateWholeNumber
 .InputTitle = Me.TextBox1.Value
 .InputMessage = Me.TextBox2.Value

End With

Unload InputForm

End Sub

Upvotes: 0

Views: 233

Answers (1)

Pᴇʜ
Pᴇʜ

Reputation: 57683

If you have a look at the documentation of the Validation object you will find that the Validation.Type property has a XlDVType enumeration which allows the following:

Type:=xlValidateInputOnly

Upvotes: 1

Related Questions