LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Locking multiple Cell Ranges with TimeStamp

Hi,

I have 31 similar sheets & each sheet having 4 similar tables.

To begin with, i have Ctrl+A all the sheets, then right-clicked &
selected Protection tab, unchecked "Locked", OK.

Take for eg. 1st table:
---------------------------
I am trying to create a TO-DO list, where in column A (TO-DO), i enter
the things to do, in Column B (STATUS), i enter the "DONE" or "NOT
DONE" (Data Validation drop-down list). The Column B Range is B2:B12.

If i select "NOT DONE", the corresponding (OFFSET) cell in Column C
(STATUS
TIME) would show the Current Time & the cell would get Locked up so
that Time will not change, even if i Change Cell in Column B to "Done".

In Column D (COMPLETION TIME), i would get the Time when the TO-DO job
was completed or DONE. i.e. if i select "DONE" from the Drop-down list
in Column C, i should get the Current time in Column D cell. THIS is
not of much concern as i can use an IF statement to check if Column B
cell ="DONE".

As i said earlier, i have 31 similar Sheets & each similar Sheet has 4
similar tables, 2 ABOVE & 2 BELOW.

How can i use the Worksheet_Change event to fire on 4 ranges? That's my
main question.

Can i use something like below, which seems applicable to 1 range (
will work on 1 table only).

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("A1:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 1)
If Me.Cells.Locked = True Then
Me.Unprotect
Me.Cells.Locked = False
End If
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
.Locked = True
Me.Protect
End With
Application.EnableEvents = True
End If
End With
End Sub

How to do this using VBA?

Can we use:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)

or

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)


Can anyone help?

 
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
Extending Look-up to multiple cell ranges sony654 Excel Worksheet Functions 4 April 5th 08 04:44 AM
Locking non-Validation cells in ranges Sandy Excel Worksheet Functions 1 September 1st 07 08:46 PM
Help in finding first empty cell in multiple ranges jonco Excel Programming 2 April 27th 06 07:32 PM
Creating drop down list for multiple cell ranges Aaron Saulisberry Excel Discussion (Misc queries) 2 May 1st 05 06:47 PM
Locking ranges Jim McLeod[_2_] Excel Programming 1 June 14th 04 02:49 PM


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

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"