I've read that some suggest it is good practice to avoid using select, so I thought I would give it a go, having tied myself in knots trying to flip from sheet to sheet and file to file.
I've written the following code, which does what it is intended to, copy a range from one file to another file.
My problem is trying to specify where I want the range to be pasted to. If I try and insert something like ws2.cells(3,3).paste it all falls apart.
Not quite getting it.
I've written the following code, which does what it is intended to, copy a range from one file to another file.
Code:
Sub Transfer()
Dim wb1 As Workbook
Set wb1 = Application.Workbooks("Arrays are us.xls")
Dim mg1 As Range
Set mg1 = wb1.Sheets("Source").Range(Cells(1, 1), Cells(3, 1))
Dim wb2 As Workbook
Set wb2 = Application.Workbooks("Home for data.xls")
Dim ws2 As Worksheet
Set ws2 = wb2.Sheets("Destination")
Dim Rng2 As Range
Set Rng2 = Cells(1, 3)
With mg1.Copy
ws2.Paste
End With
End Sub
My problem is trying to specify where I want the range to be pasted to. If I try and insert something like ws2.cells(3,3).paste it all falls apart.
Not quite getting it.