ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Password Protect Sheet (https://www.excelbanter.com/excel-programming/421134-automatic-password-protect-sheet.html)

Lorcan Dene[_2_]

Automatic Password Protect Sheet
 
I've coded a button to open a file, copy some info from 1 sheet to another,
but i need the button to first unprotect the sheet, then do its copying, then
protect the sheet when finsihed.

i've tried:

Worksheets("Sheet1!").Protect (password)
and hence
WorkSheets("Sheet1!").UnProtect (password)

but it doesnt password protect it, only protects it normally, anyone help
please?

Gord Dibben

Automatic Password Protect Sheet
 
Sheets("Sheet1").Unprotect Password:="justme"

your code to do things

Sheets("Sheet1").Protect Password:="justme"


Gord Dibben MS Excel MVP

On Wed, 10 Dec 2008 15:22:05 -0800, Lorcan Dene
wrote:

I've coded a button to open a file, copy some info from 1 sheet to another,
but i need the button to first unprotect the sheet, then do its copying, then
protect the sheet when finsihed.

i've tried:

Worksheets("Sheet1!").Protect (password)
and hence
WorkSheets("Sheet1!").UnProtect (password)

but it doesnt password protect it, only protects it normally, anyone help
please?




All times are GMT +1. The time now is 03:35 AM.

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