Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
I'd need to help how to copy last row from a sheet to another
I'm a beginer Thanks Jan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
Assume we can determine this from column A
Dim rng as Range With Worksheets("Sheet1") set rng = .Cells(rows.count,1),End(xlup) End With rng.EntireRow.Copy Destination:= _ worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) this copies the last row of sheet1 to the next empty row in sheet2 -- Regards, Tom Ogilvy "Jan" wrote in message ... I'd need to help how to copy last row from a sheet to another I'm a beginer Thanks Jan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
Tom
The (2) at the end of your code line: worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) seems to have the same effects as: .Offset(1,0) I'm not familiar with your notation. Can you explain? thanks "Tom Ogilvy" wrote: Assume we can determine this from column A Dim rng as Range With Worksheets("Sheet1") set rng = .Cells(rows.count,1),End(xlup) End With rng.EntireRow.Copy Destination:= _ worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) this copies the last row of sheet1 to the next empty row in sheet2 -- Regards, Tom Ogilvy "Jan" wrote in message ... I'd need to help how to copy last row from a sheet to another I'm a beginer Thanks Jan |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
Shortcut for Item(2)
? range("A1").Item(2).Address $A$2 Offset is 0 based, item is 1 based. -- Regards, Tom Ogilvy "gocush" /delete wrote in message ... Tom The (2) at the end of your code line: worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) seems to have the same effects as: .Offset(1,0) I'm not familiar with your notation. Can you explain? thanks "Tom Ogilvy" wrote: Assume we can determine this from column A Dim rng as Range With Worksheets("Sheet1") set rng = .Cells(rows.count,1),End(xlup) End With rng.EntireRow.Copy Destination:= _ worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) this copies the last row of sheet1 to the next empty row in sheet2 -- Regards, Tom Ogilvy "Jan" wrote in message ... I'd need to help how to copy last row from a sheet to another I'm a beginer Thanks Jan |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
with a little experimenting I see that
Range("A1")(2).Select ---will move down (A2) Selection(2).Select ------- will move down if a single cell or a vert. range while Selection(2).Select -------will move to the right in a horiz range. these then must be the defaults??? "Tom Ogilvy" wrote: Shortcut for Item(2) ? range("A1").Item(2).Address $A$2 Offset is 0 based, item is 1 based. -- Regards, Tom Ogilvy "gocush" /delete wrote in message ... Tom The (2) at the end of your code line: worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) seems to have the same effects as: .Offset(1,0) I'm not familiar with your notation. Can you explain? thanks "Tom Ogilvy" wrote: Assume we can determine this from column A Dim rng as Range With Worksheets("Sheet1") set rng = .Cells(rows.count,1),End(xlup) End With rng.EntireRow.Copy Destination:= _ worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) this copies the last row of sheet1 to the next empty row in sheet2 -- Regards, Tom Ogilvy "Jan" wrote in message ... I'd need to help how to copy last row from a sheet to another I'm a beginer Thanks Jan |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Last row
It moves within the range
and after it exceeds the range, it mimics the same pattern: Sub Demo1() For i = 1 To 10 Debug.Print Range("a2:c3")(i).Address, _ Range("A2:c3").Item(i).Address Next End Sub produces: $A$2 $A$2 $B$2 $B$2 $C$2 $C$2 $A$3 $A$3 $B$3 $B$3 $C$3 $C$3 $A$4 $A$4 $B$4 $B$4 $C$4 $C$4 $A$5 $A$5 -- Regards, Tom Ogilvy "gocush" /delete wrote in message ... with a little experimenting I see that Range("A1")(2).Select ---will move down (A2) Selection(2).Select ------- will move down if a single cell or a vert. range while Selection(2).Select -------will move to the right in a horiz range. these then must be the defaults??? "Tom Ogilvy" wrote: Shortcut for Item(2) ? range("A1").Item(2).Address $A$2 Offset is 0 based, item is 1 based. -- Regards, Tom Ogilvy "gocush" /delete wrote in message ... Tom The (2) at the end of your code line: worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) seems to have the same effects as: .Offset(1,0) I'm not familiar with your notation. Can you explain? thanks "Tom Ogilvy" wrote: Assume we can determine this from column A Dim rng as Range With Worksheets("Sheet1") set rng = .Cells(rows.count,1),End(xlup) End With rng.EntireRow.Copy Destination:= _ worksheets("Sheet2").cells(rows.count,1).End(xlup) (2) this copies the last row of sheet1 to the next empty row in sheet2 -- Regards, Tom Ogilvy "Jan" wrote in message ... I'd need to help how to copy last row from a sheet to another I'm a beginer Thanks Jan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
How copy format, font, color and border without copy/paste? | Excel Programming |