ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Password Protecting One Cell (https://www.excelbanter.com/excel-discussion-misc-queries/125728-password-protecting-one-cell.html)

Erinayn

Password Protecting One Cell
 
Here is the scenario: My group maintains informational spreadsheets for the
business. They are supposed to pull the most recent spreadsheet from our
Sharepoint site and update as appropriate and email them to use to repost.
They update the date on the template when changes are made. As a backup
process we'd like to add 1 protected cell on the spreadsheet where we'd
include an updated date so we'd know that they pulled it from the site sort
of as a version control from our end.
Is there a way to password protect that one cell easily and be able to just
enter the password update the cell and then save the document straight away
without having to reprotect the cell each time?

Gord Dibben

Password Protecting One Cell
 
With beforesave event code you could add the date to the cell when they save.

First you would unlock all the cells except the one cell for the date.

Then protect the worksheet with a password.

Enter this code in the Thisworkbook module, adjusting password and cell to suit.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
With Sheets("Sheet1")
.Unprotect Password:="password"
.Range("G4").Value = Format(Now, "dd/mm/yyyy h:mm:ss")
.Protect Password:="password"
End With
End Sub

You can lock the VBA Project from viewing in VBEditor.

Right-click on project and VBAProject PropertiesProtection

Save.


Gord Dibben MS Excel MVP


On Thu, 11 Jan 2007 09:08:01 -0800, Erinayn
wrote:

Here is the scenario: My group maintains informational spreadsheets for the
business. They are supposed to pull the most recent spreadsheet from our
Sharepoint site and update as appropriate and email them to use to repost.
They update the date on the template when changes are made. As a backup
process we'd like to add 1 protected cell on the spreadsheet where we'd
include an updated date so we'd know that they pulled it from the site sort
of as a version control from our end.
Is there a way to password protect that one cell easily and be able to just
enter the password update the cell and then save the document straight away
without having to reprotect the cell each time?




All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com