Results 1 to 4 of 4

Copy sheets, keep the format in a new workbook

Threaded View

  1. #1
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Copy sheets, keep the format in a new workbook

    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
    Last edited by john55; 10-29-2011 at 07:46 AM.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1