- 帖子
- 11
- 主題
- 1
- 精華
- 0
- 積分
- 12
- 點名
- 0
- 作業系統
- Win7 32
- 軟體版本
- Office2013
- 閱讀權限
- 10
- 性別
- 男
- 來自
- Keelong
- 註冊時間
- 2015-2-14
- 最後登錄
- 2015-3-16
|
[發問] 請教UserForm內有多個TextBox要如何簡化程序(感謝)
目前有70個TextBox並以第70為1~69的累計
輸入TextBox並按下Enter後就計入到TextBox70內因此在程序內寫入以下69個程序
請教如何簡化
目前尚須加入
1.按下滑鼠後清空TextBox內容
2.按下鍵盤"往上鍵","往下鍵"
因此程序會變得很長所以特來請教簡化方式.....感恩- Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 13 Then TextBox70.Text = Val(TextBox70.Text) + Val(TextBox1.Text)
- End Sub
- Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 13 Then TextBox70.Text = Val(TextBox70.Text) + Val(TextBox2.Text)
- End Sub
- .......
複製代碼 |
|