Edit macro - copy sheet to another workbook


Currently the macro below will, copy the active sheet from a workbook to a new workbook and will then open a 'save as' window to save the new workbook.

I would like to edit the macro so that rather than copying the active sheet to a new workbook, the sheet is instead copied and added to the workbook C:\Users\RobMarr\Google Drive\Supplier Meetings status.xlsm

It is important the active sheet is copied and not removed from the original workbook. This will be a repeat process so I will be adding copysheets to the supplier meetings status on a daily basis.

If someone could edit the code for me that would be great.

Sub Macro()

Res = Application.GetSaveAsFilename(fileFilter:="Excel Files (*.xlsx), *.xlsx")
If Res <> 0 Then ActiveWorkbook.SaveAs Res
End Sub

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


pls try
Sub Macro()

    Set sh = ActiveSheet
    Set DestWbk = Workbooks.Open("C:\Users\RobMarr\Google Drive\Supplier Meetings status.xlsm")
    sh.Copy After:=DestWbk.Sheets(DestWbk.Sheets.Count)
    DestWbk.Close False
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mikes6058Author Commented:
Thanks this worked,

I didn't want to close the destination work book so I've removed the final line. I've also changed the file path to leave the code below.

I need to add some additional steps to this macro, I've opened a new question, see link below


Sub Macro()

    Set sh = ActiveSheet
    Set DestWbk = Workbooks.Open("P:\Supplier Relations\Supplier Meetings status.xlsm")
    sh.Copy After:=DestWbk.Sheets(DestWbk.Sheets.Count)
End Sub
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.