View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default One button, Multi Cells

If you have column headers on the destination sheet the data will be copied
on to the next row each time you run the code. If no column headers then a
blank row will be left at the top of the sheet but after that the data will
all be on the next available row.

Note that a space and underscore at the end of a line is a line break in an
otherwise single line of code.

Private Sub CommandButton1_Click()
Dim rngDest As Range

'Edit "Sheet2" to your destination sheet name
With Sheets("Sheet2")
Set rngDest = .Cells(.Rows.Count, "A") _
.End(xlUp).Offset(1, 0)
End With

With ActiveSheet
.Range("A3").Copy _
Destination:=rngDest

.Range("B5").Copy _
Destination:=rngDest.Offset(0, 1)

.Range("C8").Copy _
Destination:=rngDest.Offset(0, 2)

.Range("B11").Copy _
Destination:=rngDest.Offset(0, 3)
End With
End Sub

--
Regards,

OssieMac