我是VBA的新手。我在旧项目中使用VBA excel宏编码(使用VBA的Excel验证下拉列表)。当下拉去 到列表我正在和error.The下拉数据的最大数量是由另一片Excel验证在VBA中下拉长度问题
下面收集是截图
Public Sub CORE_SetValidation(ByRef Rng As Range, ByVal Value As String)
With Rng.Validation
Call .Delete
If Value <> "" Then
Call .Add(Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=Value)
.ErrorMessage = "Please select a value from drop-down list"
.ErrorTitle = "Value Error"
.IgnoreBlank = True
.InCellDropdown = True
.InputMessage = ""
.InputTitle = ""
.ShowInput = True
.ShowError = True
End If
End With
End Sub
- VBA下拉列表中的字符或下拉列表是否有任何限制,因为从错误消息我无法知道谴责这个问题。
- 我能否得到确切的错误信息。
请复制并粘贴您的代码作为文本使其你的问题的一部分。 –
@RichHolton我已添加我的编码 – ManiMuthuPandi
语法注释:'Call'已弃用且不必要。只需使用'.Delete'和'.Add类型:= xlValidateList,AlertStyle:= xlValidAlertStop,Formula1:= Value' – ThunderFrame