Results 1 to 24 of 24

Copying a sheet without copying the command buttons

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Copying a sheet without copying the command buttons

    I have a macro that makes a copy of a sheet, changes the name of the workbook and closes. When it copies it includes the 4 command buttons that are on that sheet. How can I copy the sheet and note the command buttons? I have tried changing the properties to don't move, but to no avail they CB still copy.

    Sub Auto_Close()
    
    Sheets("LinenData").Select
        Application.DisplayAlerts = False
        myDateStamp = Format(Date, "yyyymmdd")
        Filepath = ThisWorkbook.Path & "\Ordering Backup\" & _
        myDateStamp & ".xls"
        Sheets("LinenData").Activate
            Sheets("LinenData").Copy
                      ActiveWorkbook.SaveAs Filename:=myDateStamp
                      If wsName <> "" Then
                         With ActiveSheet
                           .Name = myDateStamp
                         End With
                      End If
        ActiveWorkbook.SaveAs Filename:=Filepath
        ActiveWorkbook.Close
        Application.DisplayAlerts = True
        
    End Sub
    Thanks for the help.

    LeapingLizard
    Last edited by LeapingLizard; 10-26-2012 at 10:44 AM.

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