VBA验证列表的默认值

Kin*_*ong 3 validation excel vba

有什么方法可以在VBA中创建验证列表时显示默认值?到目前为止,我有:

.Cells(j, 7).Validation.Add Type:=xlValidateList, Formula1:="=" & "Listname"
Run Code Online (Sandbox Code Playgroud)

Mat*_*don 6

当然.在添加验证规则后,只需显式设置单元格的值:)

Dim defaultValue as String 'string right?
defaultValue = ... 'get the value you want from your [ListName]

.Cells(j, 7).Validation.Add Type:=xlValidateList, Formula1:="=" & "Listname"       
.Cells(j, 7).Value = defaultValue
Run Code Online (Sandbox Code Playgroud)