G大您好~我可否在詢問一下關於以下的改寫方式
n1 = Val(TextBox1)
n2= Val(TextBox2)
n3= Val(TextBox3)
若改寫成迴圈改怎麼寫?
以下兩個寫法都會出現錯誤.
For i = 1 To 3
For j = 1 To 3
"n" & j = 工作表1.OLEObjects("TextBox" & i).Object.Value
Next j
Next i
-------------------------------------------------------
For i = 1 To 3
For j = 1 To 3
"n" & j = Controls("TextBox" & i).Value
Next j
Next i作者: GBKEE 時間: 2011-9-8 08:47
Option Explicit
Private Sub CommandButton2_Click()
Dim N()
i = 1
ReDim N(1 To 3)
For i = 1 To 3
N(i) = 工作表1.OLEObjects("TextBox" & i).Object.Value
Next
ATO = N3 + N2
MsgBox ATO