更新时间:2023-11-30 16:00:52
将框架控件重命名为 frameColours
,然后可以循环其复选框&构建您的字符串;
Rename the frame control to frameColours
then you can loop its checkboxes & build your string;
Dim chk as Control
Dim colors as string, delimiter as string
for Each chk In Me.frameColours.Controls
if typeOf chk Is msforms.CheckBox then
if (chk.Value) then
colors = colors & delimiter & chk.Caption
delimiter = ","
end if
end if
next
With colorsSheet
.Cells(ActiveCell.Row, 1).Value = colors
End With