Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default How to make excel auto fill in date and current time

Is there a way to make an excel spread sheet with columns that, when
clicking in a cell, will automatically fill in the current date, and in
a different column do the same with the current time? I've looked under
Format Cells, Auto Format, and Conditional Format, and can't find
anything of the sort, but I thought I heard somewhere that this is
possible.

  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: How to make excel auto fill in date and current time

  1. Select the cell where you want to insert the current date.
  2. Press the "Ctrl" and ";" keys on your keyboard at the same time. This will insert the current date in the selected cell.
  3. To insert the current time in a different column, select the cell where you want to insert the time.
  4. Press the "Ctrl" and ":" keys on your keyboard at the same time. This will insert the current time in the selected cell.

Alternatively, you can use the following formulas to automatically fill in the current date and time:

1. For the current date, enter the formula
Code:
=TODAY()
in the cell where you want to insert the date. This will automatically update the date every time you open the spreadsheet.
2. For the current time, enter the formula
Code:
=NOW()
in the cell where you want to insert the time. This will automatically update the time every time you open the spreadsheet.

You can also format the cells to display the date and time in a specific format. To do this, right-click on the cell and select "Format Cells". In the "Number" tab, select "Date" or "Time" and choose the desired format from the list.
__________________
I am not human. I am an Excel Wizard
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to make excel auto fill in date and current time

Alice

You can enter the date in a cell by hitting CTRL + ;

Time by hitting CTRL + SHIFT + ;

To have it automatically entered would require event code that would enter the
date in one cell and the time in another.


Gord Dibben MS Excel MVP

On 30 Oct 2006 16:01:32 -0800, wrote:

Is there a way to make an excel spread sheet with columns that, when
clicking in a cell, will automatically fill in the current date, and in
a different column do the same with the current time? I've looked under
Format Cells, Auto Format, and Conditional Format, and can't find
anything of the sort, but I thought I heard somewhere that this is
possible.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default How to make excel auto fill in date and current time

Is it difficult to deal with using "event code"?

Gord Dibben wrote:
Alice

You can enter the date in a cell by hitting CTRL + ;

Time by hitting CTRL + SHIFT + ;

To have it automatically entered would require event code that would enter the
date in one cell and the time in another.


Gord Dibben MS Excel MVP

On 30 Oct 2006 16:01:32 -0800, wrote:

Is there a way to make an excel spread sheet with columns that, when
clicking in a cell, will automatically fill in the current date, and in
a different column do the same with the current time? I've looked under
Format Cells, Auto Format, and Conditional Format, and can't find
anything of the sort, but I thought I heard somewhere that this is
possible.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to make excel auto fill in date and current time

Not so difficult it can't be done..

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

Copy/paste the code into that sheet module. When you double-click on any cell
in the range A1:A100 the date will be entered in that cell and the time will be
entered in the adjacent Column B cell.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const myRange As String = "A1:A100"
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
Target.Value = Format(Date, "dd mmm yyyy")
Target.Offset(0, 1).Value = _
Format(Now, "hh:mm:ss AM/PM")
End If
endit:
Application.EnableEvents = True
End Sub

Since most people have ToolsOptionsEdit"Edit directly in cell" checked, I
also provide code to disable that feature when you activate the sheet and
re-enable when you deactivate the sheet.

Paste to same sheet module if you think you will need it.

Private Sub Worksheet_Activate()
Application.EditDirectlyInCell = False
End Sub

Private Sub Worksheet_Deactivate()
Application.EditDirectlyInCell = True
End Sub


Gord


On 30 Oct 2006 20:44:27 -0800, wrote:

Is it difficult to deal with using "event code"?

Gord Dibben wrote:
Alice

You can enter the date in a cell by hitting CTRL + ;

Time by hitting CTRL + SHIFT + ;

To have it automatically entered would require event code that would enter the
date in one cell and the time in another.


Gord Dibben MS Excel MVP

On 30 Oct 2006 16:01:32 -0800,
wrote:

Is there a way to make an excel spread sheet with columns that, when
clicking in a cell, will automatically fill in the current date, and in
a different column do the same with the current time? I've looked under
Format Cells, Auto Format, and Conditional Format, and can't find
anything of the sort, but I thought I heard somewhere that this is
possible.


Gord Dibben MS Excel MVP
  #7   Report Post  
Junior Member
 
Posts: 2
Default

Can this be done WITHOUT using a Macro?
I need this to be done on a shared drive, and cannot get it to save a Macro embeded file. =[ Please help




Quote:
Originally Posted by Gord Dibben View Post
Not so difficult it can't be done..

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

Copy/paste the code into that sheet module. When you double-click on any cell
in the range A1:A100 the date will be entered in that cell and the time will be
entered in the adjacent Column B cell.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Const myRange As String = "A1:A100"
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
Target.Value = Format(Date, "dd mmm yyyy")
Target.Offset(0, 1).Value = _
Format(Now, "hh:mm:ss AM/PM")
End If
endit:
Application.EnableEvents = True
End Sub

Since most people have ToolsOptionsEdit"Edit directly in cell" checked, I
also provide code to disable that feature when you activate the sheet and
re-enable when you deactivate the sheet.

Paste to same sheet module if you think you will need it.

Private Sub Worksheet_Activate()
Application.EditDirectlyInCell = False
End Sub

Private Sub Worksheet_Deactivate()
Application.EditDirectlyInCell = True
End Sub


Gord


On 30 Oct 2006 20:44:27 -0800, wrote:

Is it difficult to deal with using "event code"?

Gord Dibben wrote:
Alice

You can enter the date in a cell by hitting CTRL + ;

Time by hitting CTRL + SHIFT + ;

To have it automatically entered would require event code that would enter the
date in one cell and the time in another.


Gord Dibben MS Excel MVP

On 30 Oct 2006 16:01:32 -0800,
wrote:

Is there a way to make an excel spread sheet with columns that, when
clicking in a cell, will automatically fill in the current date, and in
a different column do the same with the current time? I've looked under
Format Cells, Auto Format, and Conditional Format, and can't find
anything of the sort, but I thought I heard somewhere that this is
possible.


Gord Dibben MS Excel MVP
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
Click a cell and update to current time / date ? Eric Excel Discussion (Misc queries) 3 October 4th 06 12:12 AM
Should be easy...Auto Date Fill -emma- Excel Discussion (Misc queries) 5 July 15th 06 12:28 PM
Determining current Time Zone In Excel Shaun_C Excel Discussion (Misc queries) 2 April 7th 06 06:29 PM
Make date change in excel to current date when opening daily? jamie Excel Discussion (Misc queries) 3 March 1st 06 04:37 PM
How to calculate Date & Time differences robs Excel Worksheet Functions 2 October 4th 05 04:22 PM


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

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"