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

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

¥»©«³Ì«á¥Ñ 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

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD