+ Reply to Thread
Results 1 to 9 of 9

Password protect as cell value

  1. #1
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Password protect as cell value

    I came across a problem with a macro button which wouldn't print on a protected sheet, so to get round it, ive had to put on every macros button unprotect and protect passwords. But some users may be clever enough to view what the password is in the macro. How would I add in the "unprotect sheet" but have it write the password which would be hidden in sheet 1 A1, and also I've heard of a macro which can make a sheet "very hidden" and then when required "very unhidden" so no one can see the password in theory???????

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Password protect as cell value

    First to apply the password simply use a line like this:
    Please Login or Register  to view this content.
    Choose your own range rather than B6. Pewrhaps a very high (but not max) row and column You are (quite rightly as there are users involed) paranoid.
    And you might as well change the password dynamically every time you save the file. But TEST carefully and save lots of backups until you're confident.
    The hardest debug I did was probably on a screensaver with paasword. I kept having to rebbot!

  3. #3
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Password protect as cell value

    I'll use this and try to incorporate the very hidden also, I have over 6000 formulas in this sheet so last thing I want is an accident or someone thinking they're funny! Thanks for the help, il let you know how it goes.

  4. #4
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Password protect as cell value

    Didn't work, The first line will come up yellow. Here is the full code, so you know what I need, Also I have this on many many graphs!!!!
    Please Login or Register  to view this content.

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

    Re: Password protect as cell value

    try this...
    Please Login or Register  to view this content.
    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-

  6. #6
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Password protect as cell value

    Says the singles graph can not be found, The actual TAB is written as Total Re Wraps(Products)
    Would the brackets on the tab confuse this then?

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

    Re: Password protect as cell value

    well it's very confused to me too! lol
    change Sheets("Total Rewraps") with Sheets("Total Re Wraps(Products)")

  8. #8
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Password protect as cell value

    No same thing again, but this time i've renamed the sheet without any brackets so it's not as confusing

    PHP Code: 
    Sub SinglesGraph()

    ' SinglesGraphPrintout Macro

    Sheets("Total Rewraps").Unprotect Password:=Sheets("3 DAYS").Range("A1").Value

        Sheets("Total Rewraps (Products)").Select
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.ChartArea.Select
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Total Rewraps").Protect Password:=Sheets("3 DAYS").Range("A1").Value
    End Sub 

  9. #9
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Password protect as cell value

    Gone back to this and redone all the macro that this was part of, I managed to make a separate sheet with the password on which is very hidden, but requires a macro to I hide in hide which I feel safer with!

+ 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