'If checkbox is true, then copy the value from the selected line to the clipboard

I have checkboxes set for each line. I would like that if the checkbox is selected after running the macro, values from one column were automatically copied to the clipboard. How to do it? So far I have written something like this.

Sub CopyCheckedRowsToClipboard()

Dim ctCB As CheckBox

'Process all checkboxes in the ActiveSheet
    For Each ctCB In ActiveSheet.CheckBoxes

'If the checkbox is checked, select the row, then copy
    If ctCB = 1 Then
        ctCB.TopLeftCell.EntireRow.Select
        ctCB.Copy
    End If
    
Next ctCB

End Sub

What am I doing wrong? The table I have: My table The effect I want to get: Effect macro



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source