ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦ó±NTextBox©M½s¸¹¤À¶}?

¦p¦ó±NTextBox©M½s¸¹¤À¶}?

¥»©«³Ì«á¥Ñ av8d ©ó 2011-9-8 08:19 ½s¿è

For i = 2 To 7
"TextBox" & i=""
Next i
End Sub

¥H¤W°µªk·|µo¥Í¿ù»~
¬O¦]¬°TextBox¬Oª«¥ó¶Ü?

­YTextBox2+TextBox3+++++TextBox7¤S¸Ó«ç¼g?

½Ð°Ý¬°¤°»ò«¬ºA·|¤£²Å¦X?(·PÁÂGBKEE ¤j¤j¸Ñ¨M¤F§ÚªººÃ°Ý)

¥»©«³Ì«á¥Ñ av8d ©ó 2011-9-7 23:50 ½s¿è

cach.rar (34.33 KB)

½Ð°Ý¬°¤°»ò«¬ºA·|¤£²Å¦X?¦³¨S¦³¤ñ¸û§ÖÂIªº§@ªk?(¨Ò¦p:¥Î°j°é)

TOP

¦^´_ 1# av8d
  1. BTO = Val(TextBox1)
  2. Bon = Val(TextBox2)
  3. Bte = Val(TextBox3)
  4. Bfy = Val(TextBox4)
  5. Boh = Val(TextBox5)
  6. Bfh = Val(TextBox6)
  7. Bot = Val(TextBox7)
  8. Ton = Val(TextBox8)
  9. Tte = Val(TextBox9)
  10. Tfy = Val(TextBox10)
  11. toh = Val(TextBox11)
  12. Tfh = Val(TextBox12)
  13. Tot = Val(TextBox13)

  14. ATO = BTO - (Ton + toh) / 10
  15. MsgBox ATO
½Æ»s¥N½X

TOP

¦^´_ 1# av8d
  1. For i = 2 To 7
  2.     Controls("TextBox" & i) = ""
  3. Next i
½Æ»s¥N½X

­YTextBox2+TextBox3+++++TextBox7¤S¸Ó«ç¼g?
TextBox2+TextBox3+++++TextBox7->¶Ç¦^¦r¦ê
Val(TextBox2)+Val(TextBox3)+++++Val(TextBox7)->¶Ç¦^¼Æ¦r

TOP

¦^´_ 2# GBKEE

Private Sub CommandButton1_Click()
For i = 2 To 4
    Controls("TextBox" & i) = ""
Next i
End Sub

    «ö¤U«ö¶s«á¥X²{¨S¦³©w¸q³o­ÓSub©ÎFunction

TOP

¦^´_ 3# av8d
¦P©Ê¸êªº°ÝÃD ½Ð§O¦Aµo¤@¦¸·s©«,®ö¶O½×¾Â¸ê·½.
±±¨î¶µ¬O¦³¤À§O  1 Form ¤Î 2 ¤u§@ªí
³o¸Ì¬O¤u§@ªíªº±±¨î¶µ, ¥Ñ¤u¨ã->±±¨î¤u¨ã½c ²£¥Íªº
  1. Private Sub CommandButton1_Click()
  2.     For i = 2 To 4
  3.         ¤u§@ªí1.OLEObjects("TextBox" & i).Object.Value = ""
  4.     Next i
  5. End Sub
½Æ»s¥N½X

TOP

G¤j±z¦n~§Ú¥i§_¦b¸ß°Ý¤@¤UÃö©ó¥H¤Uªº§ï¼g¤è¦¡
n1 = Val(TextBox1)
n2= Val(TextBox2)
n3= Val(TextBox3)
­Y§ï¼g¦¨°j°é§ï«ç»ò¼g?
¥H¤U¨â­Ó¼gªk³£·|¥X²{¿ù»~.
For i = 1 To 3
    For j = 1 To 3
        "n" & j = ¤u§@ªí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

TOP

¦^´_ 7# av8d
  1. Option Explicit
  2. 'n1 = Val(TextBox1)
  3. 'n2 = Val(TextBox2)
  4. 'n3 = Val(TextBox3)
  5. Sub Ex()
  6.     'Dim N(1 To 3)   '¤]¥i¥H
  7.     Dim N()
  8.     i = 3
  9.     ReDim N(1 To 3)
  10.     For i = 1 To 3
  11.         N(i) = ¤u§@ªí1.OLEObjects("TextBox" & i).Object.Value
  12.     Next
  13. End Sub
½Æ»s¥N½X

TOP

Option Explicit
Private Sub CommandButton2_Click()
    Dim N()
    i = 1
    ReDim N(1 To 3)
    For i = 1 To 3
        N(i) = ¤u§@ªí1.OLEObjects("TextBox" & i).Object.Value
    Next
ATO = N3 + N2
MsgBox ATO


¤£ª¾¹D¬°¤°»ò µª®×³£¬O0


End Sub

TOP

¦^´_ 9# av8d
N¬O°}¦C
ATO = N(3) + N(2)

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD