can someone help me

  • Thread starter Thread starter No
  • Start date Start date
N

No

I have a very basic worksheet which has 4 columns

A, Date
B. Time
C. what I eat
D. my blood sugar

is there any way that the date and time can be automatically put into the
cells. for example if I was to type something in columns C or D , the time
and date will fill in A & B. current time and date

Thanks in advanced
 
right click sheet tab>view code>insert this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 4 And Target.Column = 3 Or Target.Column = 4 Then
Cells(Target.Row, "a") = Date
Cells(Target.Row, "b") = Time
End If
End Sub
 
Dnia Thu, 15 Jul 2004 16:47:59 -0500, No drêczony bólem
angelologicznym zarycza³ rozpaczliwie :
I have a very basic worksheet which has 4 columns

A, Date
B. Time
C. what I eat
D. my blood sugar

is there any way that the date and time can be automatically put into the
cells. for example if I was to type something in columns C or D , the time
and date will fill in A & B. current time and date

Thanks in advanced

First of all sorry for my terrible english


You can do it without using VBA function

Date

=IF(AND($C1<>"";$D1<>"");TEXT(NOW();"RRRR-MM-DD");"")

Time

=IF(AND($C1<>"";$D1<>"");TEXT(NOW();"gg:mm");"")

PS. I've got localized version of Excel so names of formulas may
differ , because i've translated it manually . Same thing with formula
argument seperator ( depends of your local settings)
 
Thanks Don that was so simple even I could do it..........lol
Thanks to all others who offered help
 
I like this Macro, Never knew you could do such a thing. I learn so much in
this newsgroup
 
Back
Top