如何在 activeX 框架中參考選項按鈕?
例如,我需要知道它是活躍的(真)還是不活躍的(假)。
在下圖中,它概述了我為獲得我需要參考的 OB 所經歷的步驟。

提前致謝!
uj5u.com熱心網友回復:
要檢查選擇了哪個選項按鈕,您需要遍歷 frame 中的每個控制元件。. .
Dim ctrl As MSForms.Control
For Each ctrl In Worksheets("Sheet1").Frame1.Controls
If TypeName(ctrl) = "OptionButton" Then
If ctrl.Value = True Then
Exit For
End If
End If
Next ctrl
If ctrl Is Nothing Then
MsgBox "Nothing selected!", vbExclamation
Else
MsgBox ctrl.Name & " has been selected!", vbExclamation
End If
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/460545.html
上一篇:如何對一個范圍內的一個單元格值進行編號,然后在單元格的值更改時重新開始編號
下一篇:在計算SMA時處理空白單元格
