Copy only 1 sheet from 1 excel and save it another file.

1 excel file has multiple sheets. I want to copy 1 sheet into another excel file and save with a new name.
rishaanAsked:
Who is Participating?

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

x
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.

jppintoCommented:
And you want a macro to do this or just want to know how to do it manually?
0
gtglonerCommented:
Here is some code that might serve as an example. Make sure to type in exactly the sheet and workbook names asked for,  for this to function properly.
Sub movesheet()

 Dim sheetname As String
 Dim workbookname As String
 Dim newsheetname As String
 
 sheetname = InputBox("Type the name of the sheet that is to be copied and renamed")
 workbookname = InputBox("Type the name of the open workbook that the sheet is to be inserted into")
 newsheetname = InputBox("Type the new name of the sheet in the box below")

    Sheets(sheetname).Select
    Windows(workbookname).Activate
    Sheets(sheetname).Copy After:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = newsheetname
    
End Sub

Open in new window

0

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
gtglonerCommented:
Note to my above code: You must have both source and target workbooks open first before running this macro.
0
rishaanAuthor Commented:
Need to do in .Net c#

0
rishaanAuthor Commented:
 


Not working while copying and pasting--look in code attached
copypaste.txt
0
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
VB Script

From novice to tech pro — start learning today.