Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default custom button to copy a few cells and paste on somwhere else

How can i build a custom button to copy a few specific cells (B3:E2) and
paste them to a list (MY LIST) in another worksheet(REPORT SHEET)?
  #2   Report Post  
Posted to microsoft.public.excel.programming
ADG ADG is offline
external usenet poster
 
Posts: 76
Default custom button to copy a few cells and paste on somwhere else

Hi OMID

I assume you want to add the items at the end of the data on the Report
Sheet. Draw a button on the sheet with the data then add the code below
(modify as necessary).

Private Sub CommandButton1_Click()
Dim lngRow As Long
Dim R As Range

Set R = ActiveSheet.Range("B2:E5")
With Worksheets("Report Sheet")
lngLastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
.Range(.Cells(lngLastRow + 1, 2), .Cells(lngLastRow + 2, 5)).Value =
R.Value
End With

End Sub

--
Tony Green


"OMID" wrote:

How can i build a custom button to copy a few specific cells (B3:E2) and
paste them to a list (MY LIST) in another worksheet(REPORT SHEET)?

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
Copy/Paste custom Excel chart to Word/PowerPoint Andy Excel Discussion (Misc queries) 0 September 1st 09 08:51 PM
why will my copy and paste button not work Gerryites Excel Worksheet Functions 2 March 6th 08 11:10 PM
Macro to copy and paste into a custom filter Jtmturner Excel Discussion (Misc queries) 6 February 1st 07 07:14 PM
Macro for button - copy and paste rows cbrd[_13_] Excel Programming 0 January 4th 06 08:29 PM
copy & paste command button RENEE RINEHART Excel Programming 4 April 9th 04 06:10 AM


All times are GMT +1. The time now is 05:22 PM.

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

About Us

"It's about Microsoft Excel"