0
選擇什麼自己在這裏的最後一個問題繼續 - Excel combobox dropdown items based on the previous combobox自動計數條目的數量取決於ComboBox1
我加4文本框的CRIS,TRACS,文檔和TOTAL。 我想有填充上我在ComboBox1選擇什麼樣的選擇depeding上可見的計數器Tracker
Private Sub cmdBack_Click()
Unload Me
frmLogin.Show
End Sub
Private Sub cmdClear_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdMove_Click()
Dim emptyRow As Long
Sheet1.Activate 'Make Sheet1 active
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1 'Determine emptyRow
'Transfer information
Cells(emptyRow, 1).Value = txtName.Value
Cells(emptyRow, 2).Value = txtBtn.Value
Cells(emptyRow, 3).Value = txtCbr.Value
Cells(emptyRow, 4).Value = txtOrder.Value
Cells(emptyRow, 5).Value = txtTrouble.Value
Cells(emptyRow, 6).Value = ComboBox1.Value
Cells(emptyRow, 7).Value = ComboBox2.Value
End Sub
Private Sub ComboBox1_Change()
Select Case ComboBox1.Text
Case "TRACS"
With ComboBox2
.Clear
.AddItem "Complete"
.AddItem "Re-Route"
End With
Case "CRIS"
With ComboBox2
.Clear
.AddItem "Close"
.AddItem "Re-route"
.AddItem "Transfer"
End With
Case "DOCS"
With ComboBox2
.Clear
.AddItem "Completed"
.AddItem "Follow-up"
.AddItem "Reject"
End With
End Select
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
txtName.Value = "" 'Empty NameTextBox
txtBtn.Value = "" 'Empty BTN
txtCbr.Value = "" 'Empty CBR
txtOrder.Value = "" 'Empty Order Number
txtTrouble.Value = "" 'Empty Trouble Ticket Number
ComboBox1.Clear
ComboBox2.Clear
With ComboBox1
.AddItem "CRIS"
.AddItem "TRACS"
.AddItem "DOCS"
End With
txtName.SetFocus
End Sub
喜先生,謝謝你這麼多你的快速反應,是的,它絕對適合我。它現在很重要。我必須一行一行地完全理解代碼,這是我的下一個優先事項。我也想重置櫃檯,因爲這是每天都有的。我會在我的追蹤器中添加一個日期字段。所以第二天它會回到零。再次非常感謝你。 – Zhamepace
不客氣。感謝您接受我的回答。 –