View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Writing update date and time in a cell on inputs

It's easier to ask for all you want at the start, rather than bit by bit


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A3:C65550"

On Error GoTo ws_exit:
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = "" Then
.Offset(0,1).Value = ""
Else
.Offset(0, 1).Value = Date & " " & Time
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"a94andwi" wrote in
message ...

Thank you very much.
Is there maybe a way to put this function in a if-statement that checks
if it is only row 3 to 65550 that are affected?


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile:

http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=501065