Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Copy Worksheet..Howe ??
Hi,
Can anybody give the code to create a macro which will select the entire contents of worksheet1 (except the headers which are on cells A2:G2) and paste this onto the next available line on worksheet 2 ?? Easy....uh !!!!!! thanks/regards Anthony |
#2
|
|||
|
|||
Possibly
Sub Macro1() Dim rng as Range, rng1 as Range set rng = Application.UsedRange set rng1 = Range(Range("A3"),rng) rng1.copy Destination:=worksheets("sheet2").Range("A2") End sub -- Regards, Tom Ogilvy "Anthony" wrote in message ... Hi, Can anybody give the code to create a macro which will select the entire contents of worksheet1 (except the headers which are on cells A2:G2) and paste this onto the next available line on worksheet 2 ?? Easy....uh !!!!!! thanks/regards Anthony |
#3
|
|||
|
|||
Anthony
To copy to the first available row, change rng1.copy Destination:=worksheets("sheet2").Range("A2") to rng1.copy Destination:=worksheets("sheet2".Cells(Rows.Count, _ 1).End(xlUp).Offset(1, 0) Gord Dibben Excel MVP On Tue, 8 Feb 2005 15:34:04 -0500, "Tom Ogilvy" wrote: Possibly Sub Macro1() Dim rng as Range, rng1 as Range set rng = Application.UsedRange set rng1 = Range(Range("A3"),rng) rng1.copy Destination:=worksheets("sheet2").Range("A2") End sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy answer to another worksheet | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions | |||
how do I make a copy of a worksheet and retain formulas but not data | Setting up and Configuration of Excel | |||
How do I copy page setup from one worksheet & paste into new shee. | Excel Discussion (Misc queries) | |||
Copy worksheet with Pivot Table and break link to original workshe | Excel Worksheet Functions |