mardi 28 juillet 2015

use text in cell as check box caption

I'm trying to alter this line of code, .Caption = .Range("Key6!B" & myCell.Row & "").Value, in the below macro to display the corresponding value on key6 as the check box caption. None of my alterations seem to be working.

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

Any help is greatly appreciated.

Regards,




Aucun commentaire:

Enregistrer un commentaire