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

[µo°Ý] VBµ{¦¡½X¼gªk²¤Æ - «ü©w½d³ò¿é¤J

[µo°Ý] VBµ{¦¡½X¼gªk²¤Æ - «ü©w½d³ò¿é¤J

¦U¦ì¤j¤j­Ì¦n!
¥Ø«e¥¿¥HVB userform ¨Ó¿é¤J«ü©w½d³òªº¼Æ­È¡A·Q½Ð±Ð¤j¤j­Ì¥H¤Uµ{¦¡½X¬O§_¯à¥[¥H²¤Æ©O?
¹ïVBÁÙ¤£¬O«Ü¼ô¡AÁٽФj¤j­Ì±Ð±Ð§Ú!
·PÁ¤j®a!

µ{¦¡½X:
Private Sub CommandButton2_Click()
Range("B11").Value = Val(TextBox1)
Range("C11").Value = Val(TextBox7)
Range("D11").Value = Val(TextBox13)
Range("E11").Value = Val(TextBox19)
Range("B12").Value = Val(TextBox2)
Range("C12").Value = Val(TextBox8)
Range("D12").Value = Val(TextBox14)
Range("E12").Value = Val(TextBox20)
Range("B13").Value = Val(TextBox3)
Range("C13").Value = Val(TextBox9)
Range("D13").Value = Val(TextBox15)
Range("E13").Value = Val(TextBox21)
Range("B14").Value = Val(TextBox25)
Range("C14").Value = Val(TextBox26)
Range("D14").Value = Val(TextBox27)
Range("E14").Value = Val(TextBox28)
Range("B15").Value = Val(TextBox4)
Range("C15").Value = Val(TextBox10)
Range("D15").Value = Val(TextBox16)
Range("E15").Value = Val(TextBox22)
Range("B16").Value = Val(TextBox5)
Range("C16").Value = Val(TextBox11)
Range("D16").Value = Val(TextBox17)
Range("E16").Value = Val(TextBox23)
Range("B17").Value = Val(TextBox6)
Range("C17").Value = Val(TextBox12)
Range("D17").Value = Val(TextBox18)
Range("E17").Value = Val(TextBox24)
Unload Me
End Sub

  1. Private Sub CommandButton2_Click()
  2. ay = Array(1, 7, 13, 19, 2, 8, 14, 20, 3, 9, 15, 21, 25, 26, 27, 28, 4, 10, 16, 22, 5, 11, 17, 23, 6, 12, 18, 24)
  3. For i = 0 To UBound(ay)
  4. r = Int(i / 4): c = i Mod 4
  5.   [B11].Offset(r, c) = Controls("TextBox" & ay(i)).Value
  6. Next
  7. Unload Me
  8. End Sub
½Æ»s¥N½X
¦^´_ 1# liebe
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh

Hsieh¶W¯Åª©¥D¤j¤j¯u±o«Ü·PÁ§A!
¦ý¹ï©ó¥H¤U³o¤T¦æ§Ú¤£¬O«Ü¤F¸Ñ
©êºp¦]¬°¬O·s¤â·Q¦h¾Ç¤@ÂI¡A©Ò¥H°ÝÃD¤ñ¸û¦h
¤£ª¾¹D¯à§_µy·L©M§Ú¸ÑÄÀ¤@¤U
·PÁÂ!
For i = 0 To UBound(ay)
r = Int(i / 4): c = i Mod 4
  [B11].Offset(r, c) = Controls("TextBox" & ay(i)).Value

TOP

ay ¬O«ö¶¶§ÇÀx¦sButton§Ç¸¹ªº°}¦C¡A©Ò¥H¥Î°j°é¶]§¹´N¯àŪ¨ú©Ò¦³Button¤º®e
¨ä¤¤r»PcÅܼƬO­pºâ¥HB11¬°­ìÂI¡A¦ì²¾´X¦C¡A´XÄ檺­pºâ¡A§¹¦¨©p§Æ±æªº±Æ¦C¤è¦¡
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD