Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking/Unlocking based on another cell value Iriemon Excel Worksheet Functions 0 March 27th 08 02:47 PM
locking and unlocking worksheets adam Excel Worksheet Functions 6 October 31st 07 05:31 PM
Locking/Unlocking cells upon condition Brettjg Excel Discussion (Misc queries) 20 March 12th 07 06:01 AM
Locking/unlocking cells Ian Coates Excel Programming 1 February 3rd 04 04:04 PM
Locking/Unlocking a VBA Project in 2000 vs '97 - Difference? RobNew Excel Programming 3 November 2nd 03 07:29 AM


All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"