View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
yo beee yo beee is offline
external usenet poster
 
Posts: 15
Default Current time Current date.

Paul,

Thanks for the help and the code worked fine. Now, I just need to tweak it a
bit. I thought I could figure it out on my own but I am at a loss. So, here
is specifically what I need to do. At cell C9, I will add a line of text and
hit enter. I need the current date to be entered into A9 and the time to be
entered into B9. A few moments later I will add a line of text into C10, and
I need the exact date to be filled into cell A10 and the time into B10, and
so on and so on, and so. But I only need this to start on line 9 and down
from there. Hopefully, you can help me.

TIA,

yo beee

"Paul B" wrote in message
...
yo beee, right click your worksheet tab and view code, paste this in the
window that opens

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'will put the time in column A and the date in column C
' date and time in column D when you put data in column B
If Target.Count 1 Then Exit Sub
If Target.Column = 2 Then
Target.Offset(0, -1).Value = Time()
Target.Offset(0, 1).Value = Date
Target.Offset(0, 2).Value = Now
End If
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"yo beee" wrote in message
...
TIA to anyone who can help with this macro. I need a macro in EXCEL to

enter
the current time in a cell when another cell has data entered. For

instance,
if I add a number in cel B1 and select the enter button, cell A1 will

show
the computer's current time in which that data was entered. I also need

a
macro to do the very same thing with the date.
Thanks again,
yo beee