Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default copy cell B19:J19 Range datas from sheet1, and to past in sheet2

Hi Joel
Macro that should copy cell B19:J19 Range datas from sheet1, and to past in
sheet2
Paste in cell A2...Then past in A3€¦A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 datas from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default copy cell B19:J19 Range data's from sheet1, and to past in sheet2

Private Sub CommandButton2_Click()
Dim LRow as Long

LRow = Worksheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row + 1
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A"& LRow)
End Sub

For a different workbook add the workbook name to LRow and Destination.
LRow = Workbooks("Data History").Worksheets("Sheet2").Cells(Rows.Count,
"A").End(xlUp).Row + 1
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Workbooks("Data History").Worksheets("Sheet2").Range("A"&
LRow)

Mike F
"DJSK" wrote in message
...
Hi Joel
Macro that should copy cell B19:J19 Range data's from sheet1, and to past
in
sheet2
Paste in cell A2...Then past in A3.A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 data's from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up
the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copy cell B19:J19 Range datas from sheet1, and to past in sheet2

I think you want to put the data in the next empty rtow on sheet 2

Private Sub CommandButton2_Click()
with sheets("Sheet2")
LastRow = .Range("A" & Rows.Count).End(xlup).Row
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=.Range("A" & Lastrow)
end with
End Sub

"DJSK" wrote:

Hi Joel
Macro that should copy cell B19:J19 Range datas from sheet1, and to past in
sheet2
Paste in cell A2...Then past in A3€¦A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 datas from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copy cell B19:J19 Range datas from sheet1, and to past in sheet2

See also
http://www.rondebruin.nl/copy1.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"DJSK" wrote in message ...
Hi Joel
Macro that should copy cell B19:J19 Range datas from sheet1, and to past in
sheet2
Paste in cell A2...Then past in A3€¦A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 datas from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default copy cell B19:J19 Range data's from sheet1, and to past in sheet2

Joel, the next empty row would be LastRow + 1... (:

"Joel" wrote in message
...
I think you want to put the data in the next empty rtow on sheet 2

Private Sub CommandButton2_Click()
with sheets("Sheet2")
LastRow = .Range("A" & Rows.Count).End(xlup).Row
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=.Range("A" & Lastrow)
end with
End Sub

"DJSK" wrote:

Hi Joel
Macro that should copy cell B19:J19 Range data's from sheet1, and to past
in
sheet2
Paste in cell A2...Then past in A3.A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 data's from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up
the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default copy cell B19:J19 Range data's from sheet1, and to past in she

Hi Mike,

thanks for the Responce
this macro is working fine, in the last few weeks, i am not in home country
to respond you ASAP.


"Mike Fogleman" wrote:

Private Sub CommandButton2_Click()
Dim LRow as Long

LRow = Worksheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row + 1
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A"& LRow)
End Sub

For a different workbook add the workbook name to LRow and Destination.
LRow = Workbooks("Data History").Worksheets("Sheet2").Cells(Rows.Count,
"A").End(xlUp).Row + 1
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Workbooks("Data History").Worksheets("Sheet2").Range("A"&
LRow)

Mike F
"DJSK" wrote in message
...
Hi Joel
Macro that should copy cell B19:J19 Range data's from sheet1, and to past
in
sheet2
Paste in cell A2...Then past in A3.A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 data's from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up
the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default copy cell B19:J19 Range datas from sheet1, and to past in she

hi Joel,

this works well and good, thank you for your guidance. sorry for the delayed
responce, i was out of country in the last few weeks.

wiht thanks,
DJSK

"Joel" wrote:

I think you want to put the data in the next empty rtow on sheet 2

Private Sub CommandButton2_Click()
with sheets("Sheet2")
LastRow = .Range("A" & Rows.Count).End(xlup).Row
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=.Range("A" & Lastrow)
end with
End Sub

"DJSK" wrote:

Hi Joel
Macro that should copy cell B19:J19 Range datas from sheet1, and to past in
sheet2
Paste in cell A2...Then past in A3€¦A4 and so on...
It should not the disturb the previous cell values in the sheet2
It is almost backup the cell range B19:J19 datas from sheet1, store the
values in sheet2.
Because B19:J19 data combination varies time to time, I need to back-up the
values history in the sheet2, for the future reference.

Private Sub CommandButton2_Click()
Worksheets("Sheet1").Range("B19:J19").copy _
Destination:=Worksheets("Sheet2").Range("A2")
End Sub

When I click button, the above macro copies the data but it wipes the
previous cell value.

If you provide solution for storing the data in different workbook, that
will be great.

with thanks,
DJSK

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 data from sheet2 to sheet1 when sheet2 has variable # of rows Anne Excel Discussion (Misc queries) 6 February 27th 09 09:48 PM
Auto Copy from Sheet1 to Sheet2 ryguy7272 Excel Programming 6 January 10th 08 04:23 PM
A1 Sheet2 is linked to A1 sheet1 so that user enters value(abc123) a1 sheet1 and A1 sheet2 is updated pano[_3_] Excel Programming 2 October 28th 07 02:32 PM
Copy some information from sheet1 to sheet2 john_liu Excel Programming 1 March 26th 05 04:37 PM
Copy values from Sheet1 to Sheet2 Eintsein_mc2 Excel Discussion (Misc queries) 1 January 6th 05 05:02 AM


All times are GMT +1. The time now is 03:08 AM.

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"