ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatic Time from text (https://www.excelbanter.com/excel-discussion-misc-queries/187090-automatic-time-text.html)

Jakes

Automatic Time from text
 
I have an excel document used for tracking all incoming calls, Every time a
call comes in and the name is entered into column B I would like a script to
automatically enter the time into column A.

Thanks in advance for the advice

Mike H

Automatic Time from text
 
Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(, -1).Value = Time
Application.EnableEvents = True
End If
End Sub

Mike

"Jakes" wrote:

I have an excel document used for tracking all incoming calls, Every time a
call comes in and the name is entered into column B I would like a script to
automatically enter the time into column A.

Thanks in advance for the advice


Jakes

Automatic Time from text
 
Hi Mike,

Thanks for the response, Excel keeps telling me my security settings are too
high, I have dropped them to the lowest setting but it still won't let me run
the macro.

Any suggestions

Thanks

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(, -1).Value = Time
Application.EnableEvents = True
End If
End Sub

Mike

"Jakes" wrote:

I have an excel document used for tracking all incoming calls, Every time a
call comes in and the name is entered into column B I would like a script to
automatically enter the time into column A.

Thanks in advance for the advice


Jakes

Automatic Time from text
 
Never mind thanks, I saved the document closed excel and re-opened it and it
worked fine.

Thank you so much

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(, -1).Value = Time
Application.EnableEvents = True
End If
End Sub

Mike

"Jakes" wrote:

I have an excel document used for tracking all incoming calls, Every time a
call comes in and the name is entered into column B I would like a script to
automatically enter the time into column A.

Thanks in advance for the advice



All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com