- ©«¤l
- 605
- ¥DÃD
- 92
- ºëµØ
- 0
- ¿n¤À
- 648
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- 7
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- macau
- µù¥U®É¶¡
- 2013-4-5
- ³Ì«áµn¿ý
- 2019-2-10
|
¥»©«³Ì«á¥Ñ sunnyso ©ó 2013-6-1 00:19 ½s¿è
¦^´_ 1# pinklee - Dim AllBtn() As New Class1
- Private Sub UserForm_Initialize()
- Dim fcb As MSForms.CommandButton
- Dim fcbNum As Integer
- fcbWidth = 30
- fcbNum = 5 'Sheets("Á`ªí").Range("A1").Value
- ReDim AllBtn(1 To fcbNum)
- For ii = 1 To fcbNum
- Set fcb = UserForm1.Controls.Add("Forms.CommandButton.1", "CommandButton" & ii, True)
- Set AllBtn(ii).Btn = fcb
- fcb.Width = fcbWidth
- fcb.Left = (ii - 1) * fcbWidth
- fcb.Caption = "C" & ii
- Next
- End Sub
½Æ»s¥N½X ª«¥óÃþ§O¼Ò²Õ- Public WithEvents Btn As MSForms.CommandButton
- Private Sub Btn_Click()
- 'Dim ctrl As Control
- 'With UserForm1
- 'your code here
- MsgBox Btn.Caption
- 'End With
- End Sub
½Æ»s¥N½X |
|