- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 1# afu9240 - Private Sub ComboBox3_Change()
- With 工作表1
- n = Application.CountIf(.[A:A], ComboBox3 & "*")
- TextBox1.Text = ComboBox3 & Format(n + 1, "0000")
- End With
- End Sub
- Private Sub CommandButton1_Click() '新增輸入
- Dim x As Integer
- TextBox11.Text = Date
- CommandButton1.Visible = False
- CommandButton9.Visible = True
- End Sub
- Private Sub CommandButton2_Click() '結束系統
- End
- End Sub
- Private Sub CommandButton9_Click() '儲存
- Dim CT As Control
-
- For Each CT In Controls
- If CT.Parent.Name = "Page1" And CT.Name Like "*Box*" Then
- If CT = "" Then MsgBox "資料未填": Exit Sub
- End If
- Next
- ar = Array(TextBox1, ComboBox3, ComboBox1, TextBox3, TextBox4, TextBox5, TextBox6, TextBox8, ComboBox2, TextBox9, "", TextBox7, TextBox10, "", TextBox11)
- With 工作表1
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(, UBound(ar) + 1) = ar
- End With
- End Sub
複製代碼 |
|