使用单元格中的文本作为复选框标题



我试图在下面的宏中更改这行代码.Caption = .Range("Key6!B" & myCell.Row & "").Value,以在key6上显示相应的值作为复选框标题。我的改动似乎都不起作用。

With ActiveSheet
        For Each myCell In .Range(cellRange).Cells
            With myCell
                Set myBox = .Parent.CheckBoxes.Add(Top:=.Top, Width:=.Width, Left:=.Left, Height:=.Height)
                With myBox
                    .LinkedCell = linkedColumn & myCell.Row
                    .Caption = .Range("Key6!B" & myCell.Row & "").Value
                    .Name = "checkbox_" & myCell.Address(0, 0)
                End With
                .NumberFormat = ";;;"
            End With
        Next myCell
    End With

感谢您的帮助。

认为,

.Caption = WorkSheets("Key6").Range("B" & myCell.Row & "").Value

最新更新