Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi I have the code below where I am trying to copy a range A1 to G15 into another workbook but its not working please can you help. I am trying to copy from Daily stats into Daily Stats WC Template, hope you can advise?
Code:
Private Sub CommandButton1_Click()
Dim x As Workbook
Dim y As Workbook
Dim vals As Variant
Set x = ThisWorkbook
Set y = Workbooks.Open("G:Daily Stats WC Template.xlsx")
With x.Sheets("Daily Stats")
Intersect(.UsedRange, .Range("A1:G15").Copy y.Sheets("Daily Stats").Range("A1")
End With
End Sub