在VBA中创建默认值时,是否可以从验证列表中显示默认值?到目前为止,我有:
.Cells(j, 7).Validation.Add Type:=xlValidateList, Formula1:="=" & "Listname"
答案 0 :(得分: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