有什么方法可以在VBA中创建验证列表时显示默认值?到目前为止,我有:
.Cells(j, 7).Validation.Add Type:=xlValidateList, Formula1:="=" & "Listname"
当然。在添加验证规则后,只需显式设置单元格的值:)
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