標題:
[發問]
如何將Checkbox更改成OptionButton
[打印本頁]
作者:
av8d
時間:
2015-8-25 13:36
標題:
如何將Checkbox更改成OptionButton
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
複製代碼
Option Explicit
Public WithEvents CheckboxGroup As MSForms.CheckBox
Private Sub CheckboxGroup_Click()
UserForm2.xlText = CheckboxGroup.Caption
UserForm3.xlText = CheckboxGroup.Caption
End Sub
複製代碼
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
複製代碼
Public xlText As String
Dim aryCBs() As New cControlArray
複製代碼
再次感謝各位老師們!
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)