I have two separate workbooks one named ActiveWorkbook and one named Terminated Workbook. What I want to do is create a copy button on ActiveWorkbook--Templatesheet which will ask the user which sheet to copy and copy into TerminatedWokbook and named the same as the original one.
I have some code like this and since i am very new to excel macro, so of cause it does not work. Thanks
Sub CopytoTernimal()
Dim CopyName As String
CopyName = InputBox("Please enter the name of sheet which will copy to ternimal")
Sheets("CopyName").Copy
Before:=Workbooks("Terminated Employees").Sheets(1)
End Sub
Sheets(CopyName)
with no quotes. And put thatBefore
in the same line of theCopy
command. - Daniel Möllerbefore
is the problem. Be sure the CopyName exists and try without it. - Daniel Möller