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

[µo°Ý] For ... To ... ªº°ÝÃD

[µo°Ý] For ... To ... ªº°ÝÃD

For ... To ... ªº°ÝÃD

¨C¦¸¼g For i=0 To N ´N¦n¹³«ÜÀ´¡A®M¤W For j=0 To M ´N«Ü·w¡C

½Ð°Ý¦p¦ó±N³o­Ó¡G

Private arr1() As Class1©R¥O«ö¶s
Private arr2() As Class1©R¥O«ö¶s
Private arr3() As Class1©R¥O«ö¶s
..........

Private Sub UserForm_Initialize()
    ReDim arr1(Me.Frame1.Controls.Count - 1)
    For i = 0 To Me.Frame1.Controls.Count - 1
        Set arr1(i) = New Class1©R¥O«ö¶s
        Set arr1(i).Class1¿¤¥«°Ï = Me.Frame1.Controls(i)
    Next
    ReDim arr2(Me.Frame2.Controls.Count - 1)
    For i = 0 To Me.Frame2.Controls.Count - 1
        Set arr2(i) = New Class1©R¥O«ö¶s
        Set arr2(i).Class1¿¤¥«°Ï = Me.Frame2.Controls(i)
    Next
    ReDim arr3(Me.Frame3.Controls.Count - 1)
    For i = 0 To Me.Frame3.Controls.Count - 1
        Set arr3(i) = New Class1©R¥O«ö¶s
        Set arr3(i).Class1¿¤¥«°Ï = Me.Frame3.Controls(i)
    Next
..........
End Sub

²¤Æ¦¨
For i=0 To N
     For j=0 To M
        .....
        ........
     Next j
Next i

ªþ¥ó
0.zip (560.28 KB)

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-4-13 16:34 ½s¿è

¦^´_ 2# e123chen
ª«¥ó¼Ò²Õ¤¤ªº Class1¿¤¥«°Ï As MSForms.CommandButton.
ªí³æ¤¤¨S¦³¨ä¥L§@¥ÎªºCommandButton, ©Ò¥H±Nªí³æ¤¤ªº CommandButton «ü©w¬° Class1¿¤¥«°Ï §Y¥i
  1. Dim Ar() As New Class1©R¥O«ö¶s
  2. Private Sub UserForm_Initialize()
  3.     Dim e As MSForms.Control
  4.     ReDim Ar(0)
  5.     For Each e In Me.Controls  'ªí³æ¤¤ªº±±¨î¶µ¶°¦X
  6.         If e.Name Like "CommandButton*" Then '¦bªí³æ¤¤ªº±±¨î¶µªº¦WºÙ´M§ä¥]§t "CommandButton"
  7.             Set Ar(UBound(Ar)).Class1¿¤¥«°Ï = e
  8.             ReDim Preserve Ar(UBound(Ar) + 1)
  9.         End If
  10.     Next
  11. End Sub
½Æ»s¥N½X

TOP

¨þ¨þ¨þ~ for°j°é«ÜÃøÀ´... ¯uªº!
¾Ç·|«á ·|ı±o«Ü²³æ! §_«h¨ì©³ÁÙ¬O¬Ý¤£À´ ¤£·|¥Î^^"

Åý¤p§Ì¤À¨É¤@­Ó²³æªº¾Ç²ßªk
¸ÕµÛ¦bexcel¤W¼g¤@­Ó"¤E¤E­¼ªkªí" ¥ý§OµÛ¤Wgoogle§ä³á~
¦Û¤v¼g«á §A´Nı±o«Ü²³æ¤F ´N¥X®v¤F~
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¦^´_ 3# GBKEE


    ·PÁª©¤j«ü¾É¡A¤ñ§Ú­ì¨Ó­nªºÁÙ²z·Q¡C

TOP

¥»©«³Ì«á¥Ñ e123chen ©ó 2011-4-14 13:27 ½s¿è

¦^´_ 4# Min


·PÁª©¤j«ü±Ð¡C

¤E¤E­¼ªk¾Ç¹L¡C
§Ú¥»¨Ó·Q¼g¡G

For i=0 To Frames.Count-1
     For j=0 To Frames(i).Controls.Count-1
        .....
        ........
     Next j
Next i

¥i¬O¨S¦³ Frames¡A²Ä¤@¥y´N¥d¦í¤F.....

TOP

        ÀR«ä¦Û¦b : ¤Hªº¤ß¦a¬O¤@²¥¥Ð¡A¤g¦a¨S¦³¼½¤U¦nºØ¤l¡A¤]ªø¤£¥X¦nªºªG¹ê¡C -
ªð¦^¦Cªí ¤W¤@¥DÃD