0

Copying from one workbook to another workbook

Sub foo()

Dim x As Workbook
Dim y As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet

'## Open both workbooks first:

Set x = Workbooks.Open("")

Set y = Workbooks.Open("")

'Now, transfer values from x to y:

Set ws1 = x.Sheets("Master")

Set ws2 = y.Sheets("RD_MasterCopy")

ws1.Cells.Copy ws2.Cells

y.Close False

x.Close False

'Close x:
'x.Close

End Sub

problem: Stops at Setws2 Line the vba module is in y workbook

Ike
  • 9,580
  • 4
  • 13
  • 29
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 02 '23 at 05:58

0 Answers0