我想知道有办法是xlValidateAnyValue
吗?我制作了一个用户形式,用于在验证框中输入评论。因此,基本上我不需要任何某些验证,而只是评论。我知道如何创建评论,但我想以验证方式。
Private Sub CommandButton25_Click()
With ActiveCell.Validation
.Add Type:=xlValidateWholeNumber
.InputTitle = Me.TextBox1.Value
.InputMessage = Me.TextBox2.Value
End With
Unload InputForm
End Sub
如果您查看验证对象的文档,您会发现验证属性属性具有xldvType枚举,允许以下内容:
Type:=xlValidateInputOnly