Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Auto tag the time in B1 to an entry in cell A!

Hi guys,

I need to get a solution for this.

If write a data in Cell A1, how can I get in cell B1 the time on what
this data was writen.

Thanks in advance.

ADC
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Auto tag the time in B1 to an entry in cell A!

Hi,

Right click your sheet tab, view code and paste this in. Alter A1 - A100 to
suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A1000")) Is Nothing Then
Target.Offset(, 1).Value = Time
End If
End Sub

Mike


"DDavid" wrote:

Hi guys,

I need to get a solution for this.

If write a data in Cell A1, how can I get in cell B1 the time on what
this data was writen.

Thanks in advance.

ADC

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Auto tag the time in B1 to an entry in cell A!

Event code is a good way to go to get a static time stamp in a cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A, time into column B
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Me.Range("A" & n).Value < "" Then
Me.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste into that module. Edit to suit then Alt + q to return to the
Excel window.


Gord Dibben MS Excel MVP

On Wed, 5 Nov 2008 06:54:23 -0800 (PST), DDavid
wrote:

Hi guys,

I need to get a solution for this.

If write a data in Cell A1, how can I get in cell B1 the time on what
this data was writen.

Thanks in advance.

ADC


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Auto tag the time in B1 to an entry in cell A!


What is the difference from the last post solution?

Is there a reason for not using any of both?


On 5 nov, 14:04, Gord Dibben <gorddibbATshawDOTca wrote:
Event code is a good way to go to get a static time stamp in a cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A, time into column B
On Error GoTo enditall
* * Application.EnableEvents = False
* * * * If Target.Cells.Column = 1 Then
* * * * * * *n = Target.Row
* * * * * * * * If Me.Range("A" & n).Value < "" Then
* * * * * * Me.Range("B" & n).Value = Now
* * * * End If
* * End If
enditall:
* * Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste into that module. *Edit to suit then Alt + q to return to the
Excel window.

Gord Dibben *MS Excel MVP

On Wed, 5 Nov 2008 06:54:23 -0800 (PST), DDavid
wrote:

Hi guys,


I need to get a solution for this.


If write a data in Cell A1, how can I get in cell B1 the time on what
this data was writen.


Thanks in advance.


ADC


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Auto tag the time in B1 to an entry in cell A!

Both do the same thing.

Type something in column A and get the time in column B

Mike's "Time" will give you just hh:mm:ss

My "Now" will give you date and time.

Depends what you want.

Mike also uses a finite range in column A.........I don't

In my code, disabling events prevents possible infinite looping.

Adding error trap re-enables events in the case of an error

Neither are likely in this case but...................

I just stick it in to be safe.


Gord

On Wed, 5 Nov 2008 13:56:00 -0800 (PST), DDavid
wrote:


What is the difference from the last post solution?

Is there a reason for not using any of both?


On 5 nov, 14:04, Gord Dibben <gorddibbATshawDOTca wrote:
Event code is a good way to go to get a static time stamp in a cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A, time into column B
On Error GoTo enditall
* * Application.EnableEvents = False
* * * * If Target.Cells.Column = 1 Then
* * * * * * *n = Target.Row
* * * * * * * * If Me.Range("A" & n).Value < "" Then
* * * * * * Me.Range("B" & n).Value = Now
* * * * End If
* * End If
enditall:
* * Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste into that module. *Edit to suit then Alt + q to return to the
Excel window.

Gord Dibben *MS Excel MVP

On Wed, 5 Nov 2008 06:54:23 -0800 (PST), DDavid
wrote:

Hi guys,


I need to get a solution for this.


If write a data in Cell A1, how can I get in cell B1 the time on what
this data was writen.


Thanks in advance.


ADC


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto entry clock into a cell on tabbing into it John Excel Worksheet Functions 3 May 7th 07 10:23 AM
Auto Entry in a Cell englishtwit Excel Discussion (Misc queries) 4 May 17th 06 04:07 PM
Auto fill cell entry Brian Matlack Excel Discussion (Misc queries) 1 March 8th 06 10:55 PM
Auto-copy the last entry in a column to a new cell George F Excel Worksheet Functions 2 November 18th 05 07:36 PM
Time Format Auto Entry AM and PM BulaMan Excel Discussion (Misc queries) 1 December 15th 04 09:30 AM


All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"