我有一些代码试图在其中构建数据验证框。我已经在VBA中设置了所需的设置,但是不确定在VB.Net中应该如何显示
我正在使用How to pass values from an array to a drop down list in a certain cell (not combo list) in excel VBA的Davy C的指南作为指导
原始数据验证代码可以在此处显示:
Dim myArray
myArray = Array("1", "2", "3")
Range("A" & 1).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=myArray(0) & "," & myArray(1) & "," & myArray(2)
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With