Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Separating date from a Date & Time stamp | Excel Discussion (Misc queries) | |||
Date Stamp Need | Excel Worksheet Functions | |||
Create a button that will date stamp todays date in a cell | Excel Discussion (Misc queries) | |||
Date stamp spreadsheet in excel to remind me of completion date | Excel Worksheet Functions | |||
date stamp | Excel Programming |