【问题标题】:use text in cell as check box caption使用单元格中的文本作为复选框标题
【发布时间】:2015-07-29 00:28:43
【问题描述】:

我正在尝试在下面的宏中更改这行代码.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 = .Range("Key6!B" & myCell.Row).Value

标签: excel checkbox vba


【解决方案1】:
.Caption = WorkSheets("Key6").Range("B" & myCell.Row & "").Value

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    相关资源
    最近更新 更多