+ Reply to Thread
Results 1 to 5 of 5

Copy protected sheet to a NEW workbook that is not protected

Hybrid View

lsteinbach Copy protected sheet to a NEW... 12-14-2012, 10:54 AM
Cupelix Re: Copy protected sheet to a... 12-14-2012, 11:19 AM
lsteinbach Re: Copy protected sheet to a... 12-14-2012, 11:31 AM
Cupelix Re: Copy protected sheet to a... 12-14-2012, 11:50 AM
Cupelix Re: Copy protected sheet to a... 12-14-2012, 11:28 AM
  1. #1
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Copy protected sheet to a NEW workbook that is not protected

    Let me preface this by saying I've been searching over two hours on what I thought would be a simple macro to find.
    I have a master data sheet in one workbook that, when the user clicks the button, it will copy that sheet into an automatically created workbook where the user can do as they please with the data. The data in the original workbook is protected and I'd like this protection to go away in the new workbook preferably without having to enter the password.
    I'm decent with manipulating code to suit my needs but I dont know jack about vba syntax.
    Thank you for assitance in this relatively easy macro.

    - Luke

  2. #2
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy protected sheet to a NEW workbook that is not protected

    Which part are you stuck with the copying or protection?

  3. #3
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Re: Copy protected sheet to a NEW workbook that is not protected

    Selecting and copying a sheet is easy enough. I'm having trouble with creating a new workbook and pasting the specific sheet into it. I thought it would be simple, but I've looked at a ton of code, none of which is the same, and all of which had different errors for me. I have a feeling that its only a few lines of basic code. I havent looked into the password protect issue yet, I just thought of that when I typed the post. Thanks.

    - Luke

  4. #4
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy protected sheet to a NEW workbook that is not protected

    Sub CopyData()
    'here is one for multiple sheets
    Sheets(Array("Add Name","Add Name2")).select
    Sheets("Add Name").Activate
    Sheets(Array("Add Name","Add Name2")).Copy
    ActiveWorkbook.SaveAs Filename:= "Add New Filename & Path Here.xls"
    'just incase you have any links
    ActiveWorkbook.Breaklink Name:="Add Old filename & Path Here.xls", Type:=xlExcelLinks
    ActiveWorkbook.save
    End Sub

  5. #5
    Registered User
    Join Date
    12-14-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy protected sheet to a NEW workbook that is not protected

    Sub Password()
    Application.ScreenUpdating = False
    Sheets("ADD NAME").unprotect Password:="ADD PASS"
    
    
    Sheets("ADD NAME").protect Password:="ADD PASS"
    Application.ScreenUpdating = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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