¼ÐÃD:
[µo°Ý]
¦p¦ó§PÂ_§Úè©Ò¥´¤ÄªºCheckBox
[¥´¦L¥»¶]
§@ªÌ:
av8d
®É¶¡:
2012-8-1 00:08
¼ÐÃD:
¦p¦ó§PÂ_§Úè©Ò¥´¤ÄªºCheckBox
For i = 1 To 4
If Me.Controls("CheckBox" & i).Value = True
¥H¤W¬O§PÂ_1~4¬O§_¦³³Q¥´¤Ä~¦ý¬O¥L¨C¦¸¤@©w·|±q1¶}©l§PÂ_~
¬O§_¦³¤èªkÅý¥L§PÂ_þ¤@Ó¬O§Ú襴¤ÄªºCheckBox
§@ªÌ:
oobird
®É¶¡:
2012-8-1 08:06
ªþ¥ó¥Ü¨Ò
[attach]11973[/attach]
§@ªÌ:
av8d
®É¶¡:
2012-8-1 20:37
¦^´_
2#
oobird
¤j¤j~§Úªº·N«ä¬O~§Ú¦³10ÓCheckBox
§Ú§Æ±æ§ÚÂI¤@¤UCommednBurron«á±N§Ú³Ì«á¤@ÓÂI¤UªºCheckBox.CaptionªºÈ¥áµ¹TextBox1
§@ªÌ:
GBKEE
®É¶¡:
2012-8-1 20:55
¦^´_
3#
av8d
2# oobird ªþÀÉ ª«¥óÃþ§O¼Ò²Õ
Option Explicit
Public WithEvents CheckboxGroup As MSForms.CheckBox
Private Sub CheckboxGroup_Click()
'-------¤èªk1 ª½±µµ¹¥¦
UserForm1.TextBox1 = CheckboxGroup.Caption
'-------¤èªk2 ÂI¤@¤UCommednBurron
'»¡©ú UserForm1¼Ò²Õ »Ý Public xlText as String
UserForm1.xlText = CheckboxGroup.Caption
'»¡©ú UserForm1¤¤ CommednBurron µ{¦¡-> UserForm1.TextBox1 = UserForm1.xlText
'MsgBox "You Click " & CheckboxGroup.Caption & vbNewLine & _
"Value is " & CheckboxGroup.Value
End Sub
½Æ»s¥N½X
§@ªÌ:
av8d
®É¶¡:
2012-8-1 21:34
¦^´_
4#
GBKEE
G¤j§Úªº·N«ä¬O~§Ú¦³10ÓCheckBox
§Ú§Æ±æ§ÚÂI¤@¤UCommednBurron«á
±N§Ú³Ì«á¤@ÓÂI¤UªºCheckBox.Caption & CommednBurron.CaptionªºÈ¥áµ¹TextBox1
¦A¦¸·PÁÂG¤j¦b»ä·¤Ñ¸Ì©âªÅÀ°§U~ÁÂÁ±z!
è´ú¸Õ¤F¤@¤U~¤èªk2·|¥X²{¿ù»~~§Ú±NÀɮפW¶Ç¦p¤U
[attach]11987[/attach]
§@ªÌ:
Hsieh
®É¶¡:
2012-8-2 00:19
¦^´_
5#
av8d
µy·L¤F¸Ñ¤@¤Uª«¥óÃþ§Oªº¬yµ{
[attach]11992[/attach]
§@ªÌ:
GBKEE
®É¶¡:
2012-8-2 06:43
¦^´_
5#
av8d
§Ú¦b4# ¦³¼g¬O
2# oobird ªþÀÉ ª«¥óÃþ§O¼Ò²Õ
ª«¥óÃþ§O¼Ò²Õ cControlArray µ{§Ç ¦p¤U
Option Explicit
Public WithEvents CheckboxGroup As MSForms.CheckBox
Private Sub CheckboxGroup_Click()
UserForm1.xlText = CheckboxGroup.Caption
End Sub
½Æ»s¥N½X
UserForm1 ªºµ{¦¡½X
Public xlText As String
Private Sub CommandButton1_Click()
'»¡©ú UserForm1¤¤ CommednBurron µ{¦¡
UserForm1.TextBox1 = UserForm1.xlText
End Sub
Private Sub UserForm_Initialize()
Dim cCBs As Integer
Dim ctl As Control
cCBs = 0
For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox" Then
cCBs = cCBs + 1
ReDim Preserve aryCBs(1 To cCBs)
Set aryCBs(cCBs).CheckboxGroup = ctl
End If
Next ctl
End Sub
½Æ»s¥N½X
§Ú¤§©Ò¥H¤£ª½±µ¤W¶ÇÀÉ®× ¬O§Æ±æ¦U¦ì¦h½m²ß¤~·|¶i¨Bªº
§@ªÌ:
av8d
®É¶¡:
2012-8-2 13:42
¦^´_
7#
GBKEE
·PÁ¦U¦ì¦Ñ®v¦b»ä·¤Ñ¨S©ñ°²ÁÙ¨ÓÀ°¦£~¦¹µª®×Åý§Ú¾Ç²ß¤Fª«¥óÃþ§O¼Ò²Õ~
§@ªÌ:
av8d
®É¶¡:
2012-8-7 16:04
¦^´_
7#
GBKEE
½Ð°Ý¦pªGn©Ò¦³UserForm~¬O§_¥u¯à¦bUserForm1¤U·s¼WUserForm2 ? ÁÙ¬O¯à¤@¦¸«Å§i¥þ³¡UserForm ?
§@ªÌ:
GBKEE
®É¶¡:
2012-8-7 16:36
¦^´_
9#
av8d
7# ¬O
UserForm1
ªºµ{¦¡½X
¦³³\¦h UserForm ¨º¦b¨C¤@UserForm µ{¦¡½X¤¤ ¨Ì¼Ëµe¸¬Äª¼g¤U¥¦¦Û¤vªºµ{¦¡½X
§@ªÌ:
av8d
®É¶¡:
2012-8-8 11:19
¼ÐÃD:
¦p¦ó½Æ»sUserForm
§Ú·Q±NUserForm1½Æ»s¨ìUserForm2
§@ªÌ:
mark15jill
®É¶¡:
2012-8-8 11:28
¦]¤£²M·¡³æ¯Â¥þ³¡½Æ»s(®æ¦¡ ª«¥ó µ{¦¡½X) ÁÙ¬O ³æ¤@³¡¤À ¬G´£´XÂI«Øij
¤èªk1. userform1 ¶×¥X«á ¦A¶×¤J.. (name °O±o§ï ÁÙ¦³µ{¦¡½X¤º userform1°O±o§ï2
¤èªk2. userform1 ½Æ»s«á userform2¶K¤W (ª«¥ó¤@¦¸ µ{¦¡½X¤@¦¸)
§@ªÌ:
av8d
®É¶¡:
2012-8-8 15:14
¦^´_
10#
GBKEE
¦]¬°¥u§ï¥H¤U~µ{¦¡·|¿ù¶Ã!
Private Sub CheckboxGroup_Click()
UserForm2.xlText = CheckboxGroup.Caption
UserForm3.xlText = CheckboxGroup.Caption
UserForm4.xlText = CheckboxGroup.Caption
End Sub
¬O§_n¹ï
xlText ©M CheckboxGroup Åܼƪº«Å§i?
§@ªÌ:
GBKEE
®É¶¡:
2012-8-8 15:53
¦^´_
13#
av8d
n¤F¸Ñª«¥ó
[attach]12050[/attach]
§@ªÌ:
av8d
®É¶¡:
2012-8-13 14:07
¦^´_
14#
GBKEE
¤j¤j~½Ð°ÝUserForm2.xlTextªºÈ¬O?
§@ªÌ:
av8d
®É¶¡:
2012-8-13 14:29
¦^´_
7#
GBKEE
Private Sub CommandButton1_Click()
'»¡©ú UserForm1¤¤ CommednBurron µ{¦¡
UserForm1.TextBox1 = UserForm1.xlText
End Sub
UserForm1.xlTextªºÈ~¥Ø«e§Ú¹ïÀ³¤£¥X¨Ó~½Ð¤j¤j¸Ñ»¡~ÁÂÁÂ!
§@ªÌ:
av8d
®É¶¡:
2012-8-13 14:49
¦^´_
7#
GBKEE
§Ú¦b»¡©ú¸Ô²Ó¤@ÂI~¤j¤j7¼Óªº¥¿¦¡§Únªº»Ý¨D~
¦ý¬O·íUserForm¼W¥[~©Ò¿ï¨úªº³Ì«á¤@ÓCheckBox«hµLªk«ü¦V¨ì³Ì«á¤@¦¸ÂI¿ïªº~
Private Sub CheckboxGroup_Click()
UserForm2.xlText = CheckboxGroup.Caption
End Sub
¥H¤W¨S°ÝÃD
Private Sub CheckboxGroup_Click()
UserForm2.xlText = CheckboxGroup.Caption
UserForm3.xlText = CheckboxGroup.Caption
UserForm4.xlText = CheckboxGroup.Caption
End Sub
¥H¤W¬OUserForm¼W¥[«á~¥X²{¤F°ÝÃD!
§@ªÌ:
GBKEE
®É¶¡:
2012-8-14 06:42
¦^´_
17#
av8d
7# UserForm1ªºµ{¦¡½X ¬O¨Ì 2# ªºªþÀÉקï
2# ªºªþÀɤ¤aryCBs ÅÜ¼Æ ¬O Module1 ªº¤½¥ÎÅܼÆ
¦p¤µ§A¦³4ÓUserForm ¬Ò¶·¨p¦³ªº aryCBsÅܼÆ
'4ÓUserForm ªº µ{¦¡½X
Public xlText As String
Dim aryCBs() As New cControlArray
Private Sub UserForm_Initialize()
Dim cCBs As Integer
Dim ctl As Control
cCBs = 0
For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox" Then
cCBs = cCBs + 1
ReDim Preserve aryCBs(0 To cCBs)
Set aryCBs(cCBs).CheckboxGroup = ctl
End If
Next ctl
End Sub
½Æ»s¥N½X
§@ªÌ:
c_c_lai
®É¶¡:
2012-8-14 12:18
¦^´_
18#
GBKEE
Test.rar ùرz¬O¨Ï¥Î ReDim Preserve aryCBs(1 To cCBs)¡A
¦Ó¦¹³B±z¥Î ReDim Preserve aryCBs(0 To cCBs)
¤@Ó¬O±q 0 ¶}©l°_ºâ¡A ¥t¤@²Õ¬O±q 1 ¶}©l°_ºâ¡A
¦ý Test.rar ¤§ aryCBs(1 To 1) (²Ä¤@¦¸) ´N¦n¹³¨S·N¸q¤F¡H
½Ð¦h«ü±Ð¡I
§@ªÌ:
GBKEE
®É¶¡:
2012-8-14 14:38
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-14 14:42 ½s¿è
¦^´_
19#
c_c_lai
¤@Ó¬O±q 0 ¶}©l°_ºâ¡A ¥t¤@²Õ¬O±q 1 ¶}©l°_ºâ¡A¦ý Test.rar ¤§ aryCBs(1 To 1) (²Ä¤@¦¸) ´N¦n¹³¨S·N¸q¤F¡H
³o°Ýªº¦n! ·q¨Ø¤F ¬Ýªº«Ü¥J²Ó
ReDim
Preserve
aryCBs(1 To cCBs)
ReDim ³¯z¦¡ ¦bµ{§Ç¼h¦¸¤¤¥Î¨Ó«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C
cCBs = cCBs + 1
ReDim Preserve aryCBs(1 To cCBs) ' aryCBs(1 To 1) ¥u¦³¦³1¤¸¯À
½Æ»s¥N½X
cCBs = cCBs + 1
ReDim Preserve aryCBs(0 To cCBs) ' aryCBs(0 To 1) ¦³2¤¸¯À ¦h¤@¤¸¯À
½Æ»s¥N½X
ReDim Preserve aryCBs(0 To cCBs) ' aryCBs(0 To 0) ¥u¦³¦³1¤¸¯À
cCBs = cCBs + 1 '¥[¤W1¤¸¯À
½Æ»s¥N½X
ReDim Preserve aryCBs(1 To cCBs) ' aryCBs(1 To 0) ·|¦³¿ù»~
cCBs = cCBs + 1
½Æ»s¥N½X
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)