EXCEL VBA组合框中添加新的选项,
发布网友
发布时间:2022-04-30 04:54
我来回答
共2个回答
热心网友
时间:2023-10-14 09:47
Private Sub ComboBox1_Click()
[A1] = ComboBox1.Text '赋值到单元格
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "AAAA" '添加
ComboBox1.AddItem "BBBB"
ComboBox1.AddItem "CCCC"
End Sub
热心网友
时间:2023-10-14 09:47
SubMyList()
DimRngAsRange
SetRng = Cells(1, 1)
WithRng.Validation
.Delete
.Add Type:=xlValidateList, Formula1:="字段1,字段2,字段3,..."
EndWith
SetRng =Nothing
EndSub
热心网友
时间:2023-10-14 09:47
Private Sub ComboBox1_Click()
[A1] = ComboBox1.Text '赋值到单元格
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "AAAA" '添加
ComboBox1.AddItem "BBBB"
ComboBox1.AddItem "CCCC"
End Sub
热心网友
时间:2023-10-14 09:47
SubMyList()
DimRngAsRange
SetRng = Cells(1, 1)
WithRng.Validation
.Delete
.Add Type:=xlValidateList, Formula1:="字段1,字段2,字段3,..."
EndWith
SetRng =Nothing
EndSub