Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Good Morning All Could you help.

Status
Not open for further replies.

jupops

Technical User
May 15, 2003
72
GB
Good Morning All

Could you help. Is it possible to have a range of cells from a sheet in a workbook to another, and then move another range and place directly under the first range on the new sheet (in VBA code). For example:

I first move the set of cells from sheet 1 to sheet 2 :

15 200 aaa
16 220 aa1
18 220 aaa

and then move from sheet 1 to sheet 2

255 251 bbb

so sheet 2 will look like

15 200 aaa
16 220 aa1
18 220 aaa
255 251 bbb

Thank You.
Jupops
 
Perhaps not exactly what you want. Copies selected data to target sheet :-

'-----------------------------------------
Sub test()
Dim Target As Worksheet
Dim TargetRow As Long
'-----------------------
Set Target = Worksheets("Destination")
TargetRow = Target.Range("A65536").End(xlUp).Row + 1
ActiveSheet.UsedRange.Copy Destination:=Target.Range("A" & TargetRow)
End Sub
'------------------------------------------


Regards
BrianB
** Let us know if you get something that works !
================================
 
Hi Julia,

Another way ...

Code:
Dim Range1 As Range, Range2 As Range, Range3 As Range
Set Range1 = [Sheet1!A1:C3]
Code:
' Perhaps
Code:
Set Range2 = [Sheet1!H1:J3]
Code:
' Or wherever
Code:
Set Range3 = [Sheet2!A1]

Range1.Copy Destination:=Range3
Range2.Copy Destination:=Range3.Offset(Range1.Rows.Count)

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top