Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Static Time Entry

I need to use a formula that enters a static time in a cell based on the contents of another cell (the values will be 0 and 1). The NOW() function enters a dynamic time that changes each time the worksheet is recalculated. I need to enter the time as if I used the "Ctrl+Shift+:" keyboard strokes. I have tried several different things without success including a VB script that I found on a user site. In this particular application, using the "Paste Special" command in a macro would be too cumbersome. I can't believe that there is not a way to enter a static time using a formula. It looks like MicroSoft missed one here. Any suggestions??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Static Time Entry

Gino Tortelle wrote:
I need to use a formula that enters a static time in a cell based on
the contents of another cell (the values will be 0 and 1). The NOW()
function enters a dynamic time that changes each time the worksheet
is recalculated. I need to enter the time as if I used the
"Ctrl+Shift+:" keyboard strokes. I have tried several different
things without success including a VB script that I found on a user
site. In this particular application, using the "Paste Special"
command in a macro would be too cumbersome. I can't believe that
there is not a way to enter a static time using a formula. It looks
like MicroSoft missed one here. Any suggestions??


Hi Gino
have a look at
http://www.mcgimpsey.com/excel/timestamp.html
you may use the worksheet_change procedure to achieve your goal

Frank
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Static Time Entry

Assume if an entry is made in column B, you want a timestamp in Column A.

right click on the sheet tab and select View code. Paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
On Error GoTo ErrHandler
If Target.Column = 2 Then
Application.EnableEvents = False
If Not IsEmpty(Target) Then
Cells(Target.Row, 1).Value = Now
Cells(Target.Row, 1).NumberFormat = "mm/dd/yyyy hh:mm"
Else
Cells(Target.Row, 1).ClearContents
End If
End If

ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


"Gino Tortelle" wrote in message
...
I need to use a formula that enters a static time in a cell based on the

contents of another cell (the values will be 0 and 1). The NOW() function
enters a dynamic time that changes each time the worksheet is recalculated.
I need to enter the time as if I used the "Ctrl+Shift+:" keyboard strokes. I
have tried several different things without success including a VB script
that I found on a user site. In this particular application, using the
"Paste Special" command in a macro would be too cumbersome. I can't believe
that there is not a way to enter a static time using a formula. It looks
like MicroSoft missed one here. Any suggestions??


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
static date and time Wanna Learn Excel Discussion (Misc queries) 2 January 29th 09 05:05 PM
automatically enter today's date as a static entry in Excel TJ Excel Discussion (Misc queries) 3 July 25th 08 04:44 AM
Static time - again Maverick Excel Worksheet Functions 3 July 27th 06 07:12 PM
Automatically enter today's date as a static entry David Links and Linking in Excel 2 June 6th 05 12:08 AM
Automatically enter today's date as a static entry David Excel Worksheet Functions 1 June 4th 05 04:54 PM


All times are GMT +1. The time now is 08:32 AM.

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"