DEAR ALL 大大
1.如圖一 為何 X1 X2 X3 X4 我都輸入1 Range("I7") = Y會秀出 1111 而不是4
2.煩不吝賜教 THANKS ROBERT 08/25
圖一
Sub 按鈕6_Click()
X1 = InputBox("X1", "按鈕6")
X2 = InputBox("X2", "按鈕6")
X3 = InputBox("X3", "按鈕6")
X4 = InputBox("X4", "按鈕6")
Y = X1 + X2 + X3 + X4
Range("I7") = Y
End Sub作者: joshzhong 時間: 2017-8-25 14:19
要先定義變數型態, 否則vba預設為variant:
E.g.
Dim X1 As Double
Dim X2 As Double
Dim X3 As Double
Dim X4 As Double
Dim Y As Double作者: rouber590324 時間: 2017-8-25 15:13