A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can Excel automatically insert current date in a cell?



 
 
Thread Tools Display Modes
  #11  
Old March 14th, 2009, 08:07 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Can Excel automatically insert current date in a cell?

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Format(Now, "mm dd yyyy h:mm:ss")
End If
End Sub

This is sheet event code.

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

Copy/paste into that module.

Alt + q to return to the Excel window.

Enter something in a cell in column A and a static date/time will be entered
in column B


Gord Dibben MS Excel MVP

On Sat, 14 Mar 2009 10:43:03 -0700, MikeW
wrote:

Rick, I'm trying to do the same thing, could you explain the VB event code
I'd have to use?

"Rick Rothstein" wrote:

I'm assuming that once the date is added to the worksheet, you would not
want it to change. If that is the case, you will need to use VB event code
to handle this. Is a VB solution an acceptable choice?

--
Rick (MVP - Excel)


"aspect30" wrote in message
...
How can I make today's date auto fill in a cell upon entering data in
another
cell. I would like the cell B1 that contains the date to remain empty
until I
enter data in cell A1.
Please advise.
Thanks.

"Paul B" wrote:

AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this

Sheets("Sheet1").Range("A1") = Date

--
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 2002 & 2003

"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?






  #12  
Old March 15th, 2009, 06:06 PM posted to microsoft.public.excel.worksheet.functions
Michael.Tarnowski
external usenet poster
 
Posts: 95
Default Can Excel automatically insert current date in a cell?

On Mar 6, 8:26 pm, "Rick Rothstein"
wrote:
I'm assuming that once the date is added to the worksheet, you would not
want it to change. If that is the case, you will need to use VB event code
to handle this. Is a VB solution an acceptable choice?

--
Rick (MVP - Excel)

"aspect30" wrote in message

...

How can I make today's date auto fill in a cell upon entering data in
another
cell. I would like the cell B1 that contains the date to remain empty
until I
enter data in cell A1.
Please advise.
Thanks.


"Paul B" wrote:


AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this


Sheets("Sheet1").Range("A1") = Date


--
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 2002 & 2003


"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?


Hi Paul,
to implement a correct time-stamp mechanism it is sometimes necessary
to "rebuild" the time-stamping formula; have a look at
http://groups.google.com/group/micro...b447a790090855
Cheers Michael
  #13  
Old July 8th, 2009, 04:28 PM posted to microsoft.public.excel.worksheet.functions
RendaBay
external usenet poster
 
Posts: 1
Default Can Excel automatically insert current date in a cell?

I know VERY LITTLE about using Excel -- just learning -- so trial and error
is my only option. I have Excel X for Mac (a slightly older version). I want
to cause the date inside one of the cells to change automatically when I
open. I tried adding =TODAY() directly into the cell, but it only prints with
those same characters in the document. It doesn't show a date. I went into
"View Code" to try adding it there, but there is already stuff in the window.
I don't really understand how to do this. Can you help me?

"AdrianXing" wrote:

Does anyone know of a function that can make Excel automatically insert the
current date into a cell when a file is opened up?

  #14  
Old July 8th, 2009, 05:03 PM posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
external usenet poster
 
Posts: 2,496
Default Can Excel automatically insert current date in a cell?

RendaBay,

I tried adding =TODAY() directly into the cell, but it only prints with

those same characters in the document. It doesn't show a date.

Format that cell as General or with the specific date format that you prefer, then re-enter the
formula. The cell was formatted as text, which disables formulas just for that cell....

HTH,
Bernie
MS Excel MVP


"RendaBay" wrote in message
...
I know VERY LITTLE about using Excel -- just learning -- so trial and error
is my only option. I have Excel X for Mac (a slightly older version). I want
to cause the date inside one of the cells to change automatically when I
open. I tried adding =TODAY() directly into the cell, but it only prints with
those same characters in the document. It doesn't show a date. I went into
"View Code" to try adding it there, but there is already stuff in the window.
I don't really understand how to do this. Can you help me?

"AdrianXing" wrote:

Does anyone know of a function that can make Excel automatically insert the
current date into a cell when a file is opened up?



  #15  
Old February 11th, 2010, 04:45 AM posted to microsoft.public.excel.worksheet.functions
Lejothomas
external usenet poster
 
Posts: 2
Default Can Excel automatically insert current date in a cell?

Hi
I wanted to enter date automatically in A when something is entered in
D(time should be static) . On the same sheet, when someone put data in I, i
need that date and time (static) in J.

Can anyone help me please...

Thanks
Lejo

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Format(Now, "mm dd yyyy h:mm:ss")
End If
End Sub

This is sheet event code.

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

Copy/paste into that module.

Alt + q to return to the Excel window.

Enter something in a cell in column A and a static date/time will be entered
in column B


Gord Dibben MS Excel MVP

On Sat, 14 Mar 2009 10:43:03 -0700, MikeW
wrote:

Rick, I'm trying to do the same thing, could you explain the VB event code
I'd have to use?

"Rick Rothstein" wrote:

I'm assuming that once the date is added to the worksheet, you would not
want it to change. If that is the case, you will need to use VB event code
to handle this. Is a VB solution an acceptable choice?

--
Rick (MVP - Excel)


"aspect30" wrote in message
...
How can I make today's date auto fill in a cell upon entering data in
another
cell. I would like the cell B1 that contains the date to remain empty
until I
enter data in cell A1.
Please advise.
Thanks.

"Paul B" wrote:

AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this

Sheets("Sheet1").Range("A1") = Date

--
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 2002 & 2003

"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?







  #16  
Old February 11th, 2010, 05:42 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Can Excel automatically insert current date in a cell?

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("D")) Is Nothing Then
Target.Offset(0, -3).Value = Format(Now, "mm dd yyyy h:mm:ss")
End If
If Not Application.Intersect(Target, Columns("I:I")) Is Nothing Then
Target.Offset(0, 1).Value = Format(Now, "mm dd yyyy h:mm:ss")
End If
End Sub


Gord


On Wed, 10 Feb 2010 19:45:01 -0800, Lejothomas
wrote:

Hi
I wanted to enter date automatically in A when something is entered in
D(time should be static) . On the same sheet, when someone put data in I, i
need that date and time (static) in J.

Can anyone help me please...

Thanks
Lejo

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
Target.Offset(0, 1).Value = Format(Now, "mm dd yyyy h:mm:ss")
End If
End Sub

This is sheet event code.

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

Copy/paste into that module.

Alt + q to return to the Excel window.

Enter something in a cell in column A and a static date/time will be entered
in column B


Gord Dibben MS Excel MVP

On Sat, 14 Mar 2009 10:43:03 -0700, MikeW
wrote:

Rick, I'm trying to do the same thing, could you explain the VB event code
I'd have to use?

"Rick Rothstein" wrote:

I'm assuming that once the date is added to the worksheet, you would not
want it to change. If that is the case, you will need to use VB event code
to handle this. Is a VB solution an acceptable choice?

--
Rick (MVP - Excel)


"aspect30" wrote in message
...
How can I make today's date auto fill in a cell upon entering data in
another
cell. I would like the cell B1 that contains the date to remain empty
until I
enter data in cell A1.
Please advise.
Thanks.

"Paul B" wrote:

AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this

Sheets("Sheet1").Range("A1") = Date

--
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 2002 & 2003

"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?








  #17  
Old May 4th, 2010, 07:30 AM posted to microsoft.public.excel.worksheet.functions
Felix
external usenet poster
 
Posts: 90
Default Can Excel automatically insert current date in a cell?

I would like to put something in cell A1 and the current date will be shown
in cell b1 but static. How to use the following code to achieve this? Thanks.

"Paul B" wrote:

AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this

Sheets("Sheet1").Range("A1") = Date

--
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 2002 & 2003

"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?




  #18  
Old May 4th, 2010, 04:57 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Can Excel automatically insert current date in a cell?

Copy/paste this code to your sheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" Then
Target.Offset(0, 1).Value = Format(Now, "mm-dd-yyyy hh:mm")
End If
stoppit:
Application.EnableEvents = True
End Sub

If you want this for any cell in Column A use this code instead.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Me.Range("A" & n).Value "" Then
Me.Range("B" & n).Value = Format(Now, "mm-dd-yyyy hh:mm")
End If
End If
stoppitl:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 3 May 2010 23:30:02 -0700, Felix
wrote:

I would like to put something in cell A1 and the current date will be shown
in cell b1 but static. How to use the following code to achieve this? Thanks.

"Paul B" wrote:

AdrianXing, you could put =TODAY() in a cell and it will up date, if you
don't want the date to change after you put it in use some code in the
workbook open event to do it, like this

Sheets("Sheet1").Range("A1") = Date

--
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 2002 & 2003

"AdrianXing" wrote in message
...
Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?





  #19  
Old June 3rd, 2010, 07:26 AM posted to microsoft.public.excel.worksheet.functions
Md. Muhasenul Haque
external usenet poster
 
Posts: 1
Default How can I insert a date which is the first date of the following m

Hi,
How can I insert a date which is the first date of the following month of a
given date. For example, I have a number of dates and I need to put the 1st
date of the following month. Can I do it using excel formula? or will I have
to inset the 1st date of the following month manually?
Muhasenul Haque

"AdrianXing" wrote:

Does anyone know of a function that can make Excel automatically insert the
current date into a cell when a file is opened up?

  #20  
Old June 3rd, 2010, 07:41 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_8_]
external usenet poster
 
Posts: 338
Default How can I insert a date which is the first date of the following m

Hi

With first date in A1, enter in A2
=DATE(Year(A1),MONTH(A1)+1,1)

--

Regards
Roger Govier

"Md. Muhasenul Haque" Md. Muhasenul Haque @discussions.microsoft.com wrote
in message ...
Hi,
How can I insert a date which is the first date of the following month of
a
given date. For example, I have a number of dates and I need to put the
1st
date of the following month. Can I do it using excel formula? or will I
have
to inset the 1st date of the following month manually?
Muhasenul Haque

"AdrianXing" wrote:

Does anyone know of a function that can make Excel automatically insert
the
current date into a cell when a file is opened up?


__________ Information from ESET Smart Security, version of virus
signature database 5167 (20100602) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 5167 (20100602) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query for 'confirmation' rogge Running & Setting Up Queries 8 April 19th, 2005 03:26 PM
How can I get the current date to insert automatically when I se. cit General Discussion 0 March 30th, 2005 11:09 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller General Discussion 1 February 8th, 2005 10:34 AM
How to insert future date based on current date plus 14 days John Bakker General Discussion 1 January 31st, 2005 10:08 PM
Aggregating Date Data into Weeks and Quarters Roger Running & Setting Up Queries 3 July 11th, 2004 05:56 PM


All times are GMT +1. The time now is 08:28 PM.


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