Using the sub below,anytime you make an entry in col A you get now in col B. 
It’s automatic.
Goes in the sheet module. See attached.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 _
Or Target.Row < 2 _
Or Target.Column <> 1 Then Exit Sub

If Len(Application.Trim(Target)) > 0 Then _
Target.Offset(, 1) = Now
End Sub

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguille...@gmail.com

From: Indrajit $nai 
Sent: Tuesday, March 20, 2012 4:46 PM
To: excel-macros@googlegroups.com 
Subject: $$Excel-Macros$$ Need a small help, related to the Date and Time 
macro.....

Hi All,

Need a small help from you all. I have attached a file with this mail. Now if 
you open the file you can see there is a button named Login, if you click on 
it, it will take the system time and date.

There are two columns available, Name (Column A) and Login Time (Column B), now 
I want if the respective Column A is blank then it will not put the date and 
time in Column B, if there is a name in column A then only date and time will 
be captured in the column B, other wise it will give me a error message. If you 
have the code for the same then please provide me.

Thanks in advance.

-- 
Indrajit
talk2indra...@gmail.com 

Disclaimer:
This electronic message and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient you are hereby notified that 
any disclosure, copying, distribution or taking any action in reliance on the 
contents of this information is strictly prohibited and may be unlawful.
-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
 
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Attachment: Login time trackerSAS.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12

Reply via email to