Christopher has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
VBA
How can I copy a range from one sheet then paste the data to another sheet on a different drive
Copy Data to Workbook on another drive
Hi Christopher
The code below allows you to copy data from one workbook and paste it in a workbook on another drive.
Note you open the target workbook, paste the data and then close it saving the new data.
Sub CopyData
Dim WSheet As String
WSheet = "D:/NewWorkbook.xls" 'The path of the target workbook
Range("A1:G1").Copy
Workbooks.Open Filename:=WSheet 'Opens the workbook in the other drive
Sheets("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste
ActiveWorkbook.Close SaveChanges:=True 'Closes the target workbook and saves changes
End Sub
Hope this helps
Carlos