On click of button i want to copy and paste data from sheet 1 into specific cell of sheet 2
for example contents of cell b1 goes into sheet 2 in d14
and then for many others
please help
On click of button i want to copy and paste data from sheet 1 into specific cell of sheet 2
for example contents of cell b1 goes into sheet 2 in d14
and then for many others
please help
How's this
![]()
' copy the contents of sheet1 to sheet2 Sub CopyContents() With Sheet2 Cells(2, 2).Copy .Cells(14, 4) Cells(3, 2).Copy .Cells(15, 4) Cells(4, 2).Copy .Cells(16, 4) Cells(5, 2).Copy .Cells(17, 4) Cells(6, 2).Copy .Cells(18, 4) Cells(7, 2).Copy .Cells(6, 4) Cells(8, 2).Copy .Cells(9, 4) Cells(9, 2).Copy .Cells(10, 4) Cells(10, 2).Copy .Cells(11, 4) End With End Sub
Bob
Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.
Since many of the cells are adjacent in both sheets, you can do them as a group:
![]()
Sub CopyData() With Sheets("Sheet1") Sheets("Sheet2").Range("D14:D18").Value = .Range("B2:B6").Value Sheets("Sheet2").Range("D6").Value = .Range("B7").Value Sheets("Sheet2").Range("D9:D11").Value = .Range("B8:B10").Value End With End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks