hi,
I've found here this code, it works great, with an InputBox I add the new sheet's name, it copies my table, keeps the format, from activesheet in the same workbook.
What I want is to copy all sheets with a specific range from my workbook but in a new file, to be created a new one, having the same name, somewhere on desktop (.xls).
So, in the new file to have the same sheets but with the specified range.(range A1:aa50) .
I appreciate any suggestions!
Private Sub CommandButton5_Click()
Dim Sheetname As String
Dim Sheetname1 As String
Sheetname1 = ActiveSheet.Name
Sheetname = InputBox("Please enter new sheet name.")
If Sheetname = "" Then Exit Sub
Application.ScreenUpdating = False
ActiveSheet.Copy after:=Sheets(Sheetname1)
ActiveSheet.Name = Sheetname
ActiveSheet.Shapes("CommandButton1").Delete
Application.ScreenUpdating = True
End Sub
Bookmarks