Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic unlocking and locking worksheet on opening excel
Hi,
I checked the newsgroup but couldnt find my message posted hence, Im reposting .( Strangely my sent items shows that this message has been sent ). Please tell me how to set up the same. Regards, Hari India "Hari" wrote in message news:... Hi, I have got a sheet Report data in which except one cell ( cell A3 ) the whle sheet is protected. I want user to enter info in this cell before exiting the workbook otherwise the workbook will not save. Similarly when I open the worksheet I want to copy excel to automatically copy the A3 cell to J3 cell and make the A3 cell blank. I wrote the following code. When I open the worksheet excel asks me for the password. Cant excel automatically unlock the sheet and then lock the sheet. Do I have to give the password here. if so, please tell me what would be the syntax of the same. Regards, Hari India Private Sub Workbook_Open() Sheets("Report Data").Unprotect Sheets("Report Data").Cells(12, 10) = Sheets("Report Data").Cells(3, 1) Sheets("Report Data").Protect Sheets("Report Data").Cells(3, 1) = "" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic unlocking and locking worksheet on opening excel
Sheets("Report Data").Unprotect Password:="Hotdog"
Sheets("Report Data").protect Password:="Hotdog" -- Regards, Tom Ogilvy "Hari" wrote in message ... Hi, I checked the newsgroup but couldnt find my message posted hence, Im reposting .( Strangely my sent items shows that this message has been sent ). Please tell me how to set up the same. Regards, Hari India "Hari" wrote in message news:... Hi, I have got a sheet Report data in which except one cell ( cell A3 ) the whle sheet is protected. I want user to enter info in this cell before exiting the workbook otherwise the workbook will not save. Similarly when I open the worksheet I want to copy excel to automatically copy the A3 cell to J3 cell and make the A3 cell blank. I wrote the following code. When I open the worksheet excel asks me for the password. Cant excel automatically unlock the sheet and then lock the sheet. Do I have to give the password here. if so, please tell me what would be the syntax of the same. Regards, Hari India Private Sub Workbook_Open() Sheets("Report Data").Unprotect Sheets("Report Data").Cells(12, 10) = Sheets("Report Data").Cells(3, 1) Sheets("Report Data").Protect Sheets("Report Data").Cells(3, 1) = "" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locking/Unlocking based on another cell value | Excel Worksheet Functions | |||
locking and unlocking worksheets | Excel Worksheet Functions | |||
Locking/Unlocking cells upon condition | Excel Discussion (Misc queries) | |||
Locking/unlocking cells | Excel Programming | |||
Locking/Unlocking a VBA Project in 2000 vs '97 - Difference? | Excel Programming |