#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default date stamp

I have a macro that is entering data and we want to make sure the data cannot
be backdated, so we want to add a time/date stamp in a cell to the right of
the entry as soon as it is made. I know I can use the "Now" function in the
spreadsheet, but how do I do it "behind the scenes"?

Thanks!
--
paulao
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default date stamp

Sheets("Sheet1").Range("A1") = Format(Now, "mmm dd yyyy hh:mm:ss AMPM")

"paula" wrote:

I have a macro that is entering data and we want to make sure the data cannot
be backdated, so we want to add a time/date stamp in a cell to the right of
the entry as soon as it is made. I know I can use the "Now" function in the
spreadsheet, but how do I do it "behind the scenes"?

Thanks!
--
paulao

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default date stamp

Philosophaie wrote:
Sheets("Sheet1").Range("A1") = Format(Now, "mmm dd yyyy hh:mm:ss AMPM")

<snip top of upside-down reply

Why not simply

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

?

Stewart.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default date stamp

I am assuming that you are doing a row level entry, and lets say your last
data entry column is F (6th Column) and you need the time stamp in column G.

Paste the code behind the worksheet

--------------
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next

If Target.Column = 6 Then

ActiveCell.Offset(0, 1).Value = Now()
End If


End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default date stamp

On Mar 5, 4:22*am, Stewart Gordon wrote:
Philosophaie wrote:
*Sheets("Sheet1").Range("A1") = Format(Now, "mmm dd yyyy hh:mm:ss AMPM")


<snip top of upside-down reply

Why not simply

* *Sheets("Sheet1").Range("A1") = Now

?

Stewart.


"Sheets("Sheet1").Range("A1") = Now" should work fine. It should also
give it a custom default format of "m/d/yyyy h:mm".

Matt


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
Separating date from a Date & Time stamp JT Excel Discussion (Misc queries) 9 June 10th 08 05:55 PM
Date Stamp Need Harvey Gersin Excel Worksheet Functions 3 July 2nd 06 07:13 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
Date stamp spreadsheet in excel to remind me of completion date Big fella Excel Worksheet Functions 1 October 18th 05 04:10 PM
date stamp shawn modersohn Excel Programming 8 January 19th 04 11:18 AM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"