LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to apply it...

I applied it to the first sheet named "Quote".

In 2003 Excel, I can only right click on the sheet and go to code.
I will copy and paste and make it run

Thanks for your help!

"Mark Ivey" wrote:

Which sheet did you paste the code to?

What needs to be done is when you open the Visual Basic Editor is to double
click on the sheet you need to monitor for this change event.

Then paste the code below into the right hand screen. This code will monitor
to see when cells A1, B1, C1, D1, and E1 have something in them. When all
these cells have some type of data in them, the code will unprotect the
sheet and prompt you with a Messagebox letting you know it has been
unprotected. You can change the A1, B1, etc. references to the cells you
need to monitor. I just used these to get you started.

Mark Ivey


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Range("A1").Value < "" And Range("B1").Value < "" And _
Range("C1").Value < "" And Range("D1").Value < "" And _
Range("E1").Value < "" Then


If ActiveSheet.ProtectContents = True Then
Sheets(ActiveSheet.Name).Unprotect
MsgBox "Your worksheet is now unlocked", vbOKOnly
End If

End If

End Sub


 
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
Lock cells in a shared workbook Jennifer Excel Discussion (Misc queries) 1 December 14th 09 08:45 PM
Filled cells dont appear as filled SMILLS Excel Discussion (Misc queries) 6 October 18th 07 05:28 PM
Lock cells in shared workbook Raj Excel Worksheet Functions 0 December 16th 06 01:51 AM
lock cells until one cell is filled Debbie Excel Programming 2 May 23rd 06 06:39 PM
Can i add up all green filled cells in a workbook? Richelle Excel Worksheet Functions 1 November 30th 05 05:40 AM


All times are GMT +1. The time now is 10:00 PM.

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

About Us

"It's about Microsoft Excel"