View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Tinker,

Here is some VBA code that will enter today's date in any cell selected
within A1:A100

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
With Target
.Value = Date
.NumberFormat = "dd mmm yyyy"
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Tinker" wrote in message
...
Hey all,

My boss asked me to come up with a spreadsheet that logs the type of
computer problem we've had and what we did to fix. He also wants each

entry
to be dated in automatically, to make things easier. So, I tried using the
NOW() forumla in the following way:

=IF(ISBLANK(A2),"",NOW())

This would immediatly paste the current date if anyone entered in a name
entry. The only problem I ran into was that the NOW() function continually
updates, even after the entry is put in. So all of my data entries end up
looking like the same date.

My question: Is there a way to do this with the date remaining static,

like
a stamp almost, when it's entered?

Thanks! I appreciate any help you guys and girls can provide.

-Tinker