How to copy data from certain cell in one tab to another tab

C

Cent100

I am wanting to set up a worksheet so a user can click a check box (or
whatever the best method would be) and copy that row to another worksheet in
the workbook (or another workbook) in the next cell down each time it is
checked.

i.e.

()A B C
1 2 3

checking the box would copy 1 2 3 to the worksheet/workbook of choice in the
next empty row.

Thanks
 
G

Gord Dibben

One method.........double-click event code on any cell in the row.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = Target.EntireRow
Set rng2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
rng1.Copy Destination:=rng2
Cancel = True
End Sub

Or a macro assigned to a button.

Sub copy_to_sheet()
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = ActiveCell.EntireRow
Set rng2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
rng1.Copy Destination:=rng2
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top