Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multi cells selected greg Excel Programming 3 February 28th 08 10:58 PM
multi line cells Joanne[_4_] Excel Programming 7 July 19th 06 04:06 AM
multi line caption on command button?? neowok[_87_] Excel Programming 3 February 16th 06 09:50 AM
multi function cells kellerfro Excel Discussion (Misc queries) 4 June 27th 05 07:34 PM
Multi Select Cells David Excel Programming 2 February 15th 05 06:35 PM


All times are GMT +1. The time now is 09:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"