Hello Ravi, The code provided by you is trying to replace book 2.
However I want the code to copy the sheet "Feedback" of Book 1 and paste it with the name provided in cell P2 in book2 as the last sheet and close the book2 automatically. If the book2 is not available in the path provided in P1 of Book1 it should show a message asking the user to create a file with the above name run the macro(button in sheet1 of book1). Attaching the book1 with code provided by you. Hope I am clear with my query. -- Regards Santosh santoshkumar.subu...@gmail.com Date: Wed, 1 May 2013 03:56:04 -0700 From: ravi_colw...@yahoo.com Subject: Re: $$Excel-Macros$$ copy the active worksheet and paste it to another workbook in a given path. To: excel-macros@googlegroups.com here is the code... Sub filecopy() sheetname = ActiveWorkbook.ActiveSheet.Range("a16") Path = ActiveWorkbook.ActiveSheet.Range("a15") Sheets("Sheet1").Select Sheets("Sheet1").Copy ActiveWorkbook.SaveAs Path & "\" & "book2", FileFormat:=56 ActiveSheet.Name = sheetname ActiveWorkbook.Sheets(sheetname).Range("a15:a16") = "" ActiveWorkbook.Save ActiveWorkbook.Close End Sub --- On *Tue, 4/30/13, santosh subudhi <santoshkumar.subu...@gmail.com>*wrote: From: santosh subudhi <santoshkumar.subu...@gmail.com> Subject: $$Excel-Macros$$ copy the active worksheet and paste it to another workbook in a given path. To: "excel-macros" <excel-macros@googlegroups.com> Date: Tuesday, April 30, 2013, 11:48 PM Hello Team, I need a code that will copy the active worksheet and paste it to another workbook in a given path. The path will be in one of the cells of the active worksheet. For example my active workbook name is book1 and I want the sheet 1 of book 1 to be copied and save it in another workbook named book2 as the last worksheet. The path of book 2 is in cell A15 of Sheet 1 of book 1. Once the sheet is moved to book 2 the sheet name should also be changed.The name of the sheet is saved in Cell A16 of sheet1 of book1. -- Regards Santosh santoshkumar.subu...@gmail.com<http:///mc/compose?to=santoshkumar.subu...@gmail.com> -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Book1.xlsm
Description: Binary data