|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub CommandButton1_Click()
Dim i As Long
With Sheets("报价记录")
i = .[a1].CurrentRegion.Rows.Count + 1
.Cells(i, 1) = TextBox1.Text
.Cells(i, 2) = TextBox2.Text
.Cells(i, 3) = TextBox3.Text
.Cells(i, 4) = ComboBox1.Text
.Cells(i, 6) = ComboBox2.Text
.Cells(i, 7) = ComboBox3.Text
.Cells(i, 8) = ComboBox4.Text
.Cells(i, 9) = ComboBox5.Text
.Cells(i, 10) = ComboBox6.Text
End With
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "刘备"
ComboBox1.AddItem "张飞"
ComboBox1.AddItem "关羽"
ComboBox1.AddItem "吕布"
ComboBox1.AddItem "典韦"
ComboBox2.AddItem "曹操"
ComboBox2.AddItem "孙权"
ComboBox2.AddItem "黄盖"
ComboBox2.AddItem "甘宁"
ComboBox2.AddItem "大乔"
ComboBox2.AddItem "小乔"
End Sub
重复的量太大,你照着这样把其余的 combobox 的初始代码写进去就好了。 |
|