如何在vb中设置下拉列表框中的选项?
我在vb中生成一张在EXCEL表,在表中做了一个下拉列表框,让用户选择,生成下拉列表框的vb如下,在这个Formula1:="dsg,sg,sgd"语句中,如果用字符串常量是可以的,如果换成字符串变量就不行,比如变量strTemp="a,b,c", 语句换成Formula1:=strTemp,就出错,请问该如何使用这个变量?
With exSheet1.Range("b3").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="dsg,sg,sgd"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With