View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Al 305 Al 305 is offline
external usenet poster
 
Posts: 2
Default Getting around Protected Worksheet (number format)

Hi..
I have this command which put a timestamp on a cell every time you
write something in another cell.. I then use a NumberFormat command to
put the timestamp in H:MM.. But when i protect my worksheet (this
Worsheet Needs to be protected), it gives an error.. I am trying to
get a way around it.. My first idea is to have an other worksheet that
would =sheet1! .. This worsheet (2) wouldnt be protected, so the
number format macro would work.. My problem is that since the worsheet
(2) is not the active, it does not recalculate the timestamp
function.. Here is the Command:

Private Sub Worksheet_Activate()
Call Recalculate
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = Range("P13").Address Then
Range("H13").Value = Now
End If

If Target.Address = "$H$13" Then
Target.NumberFormat = "h:mm"
End If
End Sub

I am sure that there are different ways to solve this problem..Anybody
would know a way around this?