LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
TBD TBD is offline
external usenet poster
 
Posts: 41
Default Event Procedure - Extending code

Hi all,

I was very kindly helped out (by Tom Ogilvy) to create an event procedure
code that locks a cell on a worksheet as soon as something is entered into
that cell. The code itself is as follows:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler:
If Target.Address = "$B$8" Then
Application.EnableEvents = False
Me.Unprotect
If Target.Value = "Null" Then
Range("B8").Locked = False
Else
Range("B8").Locked = True
End If
Me.Protect
Application.EnableEvents = True
End If
ErrHandler:
Application.EnableEvents = True
If Err.Number < 0 Then
End If
End Sub

However, I am now trying to to get the code to look at more than just one
cell, and have been struggling with this for the last day! Does anyone know
if it will be possible to do this using the code above, and if so, how would
I go about it? I have tried repeating the if loops etc. but with no luck!

Thanks in advance for any help!!

TBD
 
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
Event Procedure Paul Johnson[_2_] Excel Programming 1 February 2nd 05 01:29 PM
Event Procedure again Paul Johnson[_2_] Excel Programming 1 February 2nd 05 01:28 PM
change event procedure benb Excel Programming 2 September 24th 04 09:22 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 12:21 PM.

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"