C
Cheryl
Is there any way to click on a checkbox beside a row of information and copy
that row of data to an active cell?
that row of data to an active cell?
Cheryl said:Thank you.. once again.. u may have saved my life...
seemsDave Peterson said:Maybe.
If your active cell is in column A, you can copy that whole row to the
activecell's row.
If you use a checkbox from the forms toolbar, you can add as many as you want to
the worksheet. But assign each of them the same common macro:
Option Explicit
Sub testme01()
Dim myCBX As CheckBox
Dim myCopyObjectsWithCells As Boolean
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)
If myCBX.Value = xlOn Then
If myCBX.TopLeftCell.Row = ActiveCell.Row Then
'do nothing
Else
myCopyObjectsWithCells = Application.CopyObjectsWithCells
Application.CopyObjectsWithCells = False
myCBX.TopLeftCell.EntireRow.Copy _
Destination:=ActiveSheet.Cells(ActiveCell.Row, "A")
With Application
.CutCopyMode = False
.CopyObjectsWithCells = myCopyObjectsWithCells
End With
End If
End If
End Sub
But there might be a better way of doing what you really want. Thisanda
little overkill to me.
What about if I don't want to copy the whole row.. but just a range of cells
beside the checkbox... ? I tried to substitute Range for Entirerow (since I
want to copy a range of information but it is not always in the same spot)
and just specify the columns.. but that wouldn't work..