Time Question...is this possible?

M

mileslit

I am fairly new to excel but I have a general understanding of the
software....I am use to using flash for certain things so I find myself
wanting to use and "on click" type reference....Here is what I mean....I
want a formula that tells cell B
when Cell a has data entered, place the Static date into cell B....Now
I understand I could use an if Statement to using "Today" as the true
variable, problem is The "today" variable is not static, it is
constantly updated....Is there a Static Time variable that will
automatically pop in or is the only static time variable the control
shift + :...any advice I can get will be appreciated...Thanks...
 
R

Rowan

You could use the VBA Date function with a sheet change event:

For example if you wanted the date in column B every time data in column
A was added (or changed) then:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
Application.EnableEvents = False
If Target.Count = 1 And Target.Column = 1 Then
Cells(Target.Row, 2).Value = Date
End If
ErrorHandler:
Application.EnableEvents = True
End Sub

This is worksheet event code. Right click the sheet tab, select view
code and paste the code in there.

Hope this helps
Rowan
 
Top