我有一个带有许多ActiveX单选按钮的excel源工作表,我正在使用VBA脚本进行复制。
为此,我需要使单选按钮的组名适应工作表的名称(作为变量n可用)
我要解决的方法是在每个组名的末尾添加工作表的名称;
currentradiobuttongroupname = currentradiobuttongroupname + n
到目前为止,我有:
Sub radioomzetter(ActiveSheet, n)
Dim Ctrl As OLEObject
For Each Ctrl In ActiveSheet.OLEObjects
If TypeName(Ctrl.Object) = "OptionButton" Then
Ctrl.Object.GroupName = Ctrl.Object.GroupName && n
End If
Next Ctrl
End Sub
不幸的是,这给出了语法错误。我将不胜感激。
答案 0 :(得分:0)
.GroupName && n看起来不正确。一个&就足够了。 – Variatus