推 LPH66: 因為 c 沒有值, Val 之後變成 0 了 05/12 21:07
→ areric: 感謝大大 終於找到問題了 那除了預先在格子內填入數值外 05/13 09:17
→ areric: 還有其他方法嗎? 謝謝 05/13 09:17
→ MOONRAKER: 你有聽過if嗎 05/13 09:51
→ waiter337: Private Sub a_Change() 05/14 11:10
→ waiter337: call cal 05/14 11:11
→ waiter337: end sub 05/14 11:11
→ waiter337: sub cal() 05/14 11:11
→ waiter337: if a.Text="" or a.Text = 0 then exit sub 05/14 11:12
→ waiter337: if b.Text="" or b.Text = 0 then exit sub 05/14 11:12
→ waiter337: if c.Text="" or c.Text = 0 then exit sub 05/14 11:13
→ waiter337: d.Text = Val(a.Text) * Val(b.Text) / Val(c.Text) 05/14 11:13
→ waiter337: end sub 05/14 11:13
→ waiter337: 另外textbox的IMEmode 要改成8 05/14 11:14
→ waiter337: 如果想全靠鍵盤操作 05/14 11:15
→ waiter337: 可以把前三行取消 05/14 11:15
→ waiter337: 改用 05/14 11:16
→ waiter337: Private Sub a_KeyDown(ByVal KeyCode As MSFors.Retur 05/14 11:17
→ waiter337: nInteger, ByVal Shift As Integer) 05/14 11:17
→ waiter337: If KeyCode = 13 Or KeyCode = 9 Then 05/14 11:17
→ waiter337: Application.EnableEvents = False 05/14 11:17
→ waiter337: Call cal 05/14 11:17
→ waiter337: KeyCode = 0 05/14 11:18
→ waiter337: b.SetFocus 05/14 11:18
→ waiter337: Application.EnableEvents = True 05/14 11:18
→ waiter337: End If 05/14 11:18
→ waiter337: End Sub\ 05/14 11:18
→ waiter337: \ 刪掉 不小心按到 05/14 11:19