ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Automatically insert date (https://www.excelbanter.com/excel-worksheet-functions/238885-automatically-insert-date.html)

sheryar khan

Automatically insert date
 
Hi!
I have column "A" for date. I want to do that if I enter data in
column "B" column, Column "A" automaticcaly insert today date. I have
the following function but when I open my worksheet next time it
automatically change that date to current date.

=IF(B6="","",TODAY())

Is this possible.

Dave Peterson

Automatically insert date
 
Take a look at JE McGimpsey's site:
http://www.mcgimpsey.com/excel/timestamp.html

sheryar khan wrote:

Hi!
I have column "A" for date. I want to do that if I enter data in
column "B" column, Column "A" automaticcaly insert today date. I have
the following function but when I open my worksheet next time it
automatically change that date to current date.

=IF(B6="","",TODAY())

Is this possible.


--

Dave Peterson

Gord Dibben

Automatically insert date
 
Right-click on the sheet tab and "View Code"

Copy/paste this event code into that sheet module.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B:B")) Is Nothing Then
With Target
If .Value < "" Then
.Offset(0, -1).Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

When data is entered in column B a static date/time will be entered in
column A


Gord Dibben MS Excel MVP

On Tue, 4 Aug 2009 09:06:37 -0700 (PDT), sheryar khan
wrote:

Hi!
I have column "A" for date. I want to do that if I enter data in
column "B" column, Column "A" automaticcaly insert today date. I have
the following function but when I open my worksheet next time it
automatically change that date to current date.

=IF(B6="","",TODAY())

Is this possible.




All times are GMT +1. The time now is 07:20 AM.

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