Time #2

I need to be able to click on a cell and have it be populated with the 
current HH:MM:SS.  I know ctrl+shift+; will do the job but I need it to be 
even more simple than that for the end users.  
0
Tom7430 (437)
11/18/2008 4:40:20 PM
excel.newusers 15348 articles. 1 followers. Follow

1 Replies
551 Views

Similar Articles

[PageSpeed] 50

One way:

Put this in the worksheet code module (right-click the worksheet tab and 
choose View Code):

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
        With Range("J1")
            If Not Intersect(Target, .Cells) Is Nothing Then
                .Value = Time
                .NumberFormat = "HH:MM:SS"
            End If
        End With
    End Sub

or, if you only want it to update once:


    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
        With Range("J1")
            If Not Intersect(Target, .Cells) Is Nothing Then
                If IsEmpty(.Value) Then
                    .Value = Time
                    .NumberFormat = "HH:MM:SS"
                End If
            End If
        End With
    End Sub

Note that this will also fire if the user presses an arrow key to enter 
the cell. If you'd rather, you can use a double-click:


    Private Sub Worksheet_BeforeDoubleClick( _
            ByVal Target As Excel.Range, Cancel As Boolean)
        With Range("J1")
            If Not Intersect(Target, .Cells) Is Nothing Then
                If IsEmpty(.Value) Then
                    .Value = Time
                    .NumberFormat = "HH:MM:SS"
                    Cancel = True
                End If
            End If
        End With
    End Sub



In article <AB88CB3F-6674-490F-8B7F-951C83BF7E71@microsoft.com>,
 Tom <Tom@discussions.microsoft.com> wrote:

> I need to be able to click on a cell and have it be populated with the 
> current HH:MM:SS.  I know ctrl+shift+; will do the job but I need it to be 
> even more simple than that for the end users.
0
jemcgimpsey (6723)
11/18/2008 5:41:32 PM
Reply:

Similar Artilces:

The Case of the Disappearing Macro Tool Bars #2
Brian & Gord, Thank you both for the information. I have performed a thorough searc of my hard drive and all network drives. This PC was previously used b a former employee and his .xlb file was still located on the C drive. didn't know whether this may have caused any issues so I deleted it an have copied mine to another location to use as a backup. Many things seem to change overnight as various upgrades are mad across the network so I suspect these occasionally cause problems suc as mysterious disappearances. I have noticed occasional issues wit other applications as well. Tha...

emails appearing after 4 years, again! #2
I've recieved an email that was sent to me 4 years ago, in my Inbox. What causes this? The Sender is still working with me and he definitely does not have a copy of the letter. ...

QuickBooks Integration #2
I mapped RMS COGS: Total - to Debit Account COGs and Credit Account Current Liability and RMS Sales: Total + Tax - to Debit Account Bank and Credit Account Income. I post batch to QuickBooks and it says batch has been posted. Nothing shows up in the COGS or Income accounts in Quickbooks when I look at the GL. The Journal entries in QuickBooks look correct. Shouldn't I be able to see these numbers in the GL? Or how else can I see them? Maybe some QuickBooks preferences I need to change? Hi Donna, I think you should be able to see those numbers in QB. Do you use account numbers in Q...

Time zone
When I noticed the clock on my pc was wrong, I changed the time zone from Pacific to Eastern which is my correct U.S. time zone. After doing this, all of the items inserted as "all day" appointments in my monthly calendar are displayed with an image of a clock on either side of the appointment. The option to display clocks is turned off in the settings. Why is this happening and how can I prevent it from happening. Right now, I've had to put back the Pacific time zone and adjust to the pc not telling the right time. Is there any other solution? Thanks! ddlaz No ...

User logon name: President #2
I've got another problem with my boss's account. His user name is President, but his Alias is f.e. AAA (email AAA.BBB@domena). Almost everything is working (OMA, OWA, exchange mail access), but when I'm trying to connect from Outlook 2003 using POP3 is saying that pop3 doesn't accept user name or password - President as well as AAA (alias). In other accounts this is working good. Is maybe President prohibited user name? Regards Filip ...

Send/Receive continues 1000s of times
When Outlook does its regular send/receive it ends up sending and receiving thousands of times. The task pane shows an ever increasing number of tasks that it says have been completed successfully. When all it actually is doing is rechecking the mail accounts I have, over and over again. Literally thousands of times. This interferes with anything that I want to do in Outlook while this is going on. It seems to have started after I downloaded either the latest version of itunes or the latest version of Adobe (or some other application like that). Help! And thanks. Per Roady - MVP, th...

New Computer #2
I just bought a new computer and have the downloaded version of Money 2005. How can I transfer the program to my new computer? Thanks Transfer **the program**? By re-downloading it. See http://umpmfaq.info/faqdb.php?q=159. Note that they've moved the download to http://www.microsoft.com/money/special/ThankYou.mspx and you will have to use the Passport you originally used to buy M05 online. Next time, buy the CD. Microsoft is using the "online download" thing to cull older versions by making sure that people can't keep reusing older version CDs on computer after com...

One time code
In either an SDI or MDI application, if I want to include some functionality ( such as serial port configuration and control thread) that can only be run once per application instance, where should that code go? I looked at the App class but it doesn't handle user messages ( at least by default ). Should the main code and worker thread go in the MainFrm class in the OnCreate function? Help? Ron H. ----------------- www.Newsgroup-Binaries.com - *Completion*Retention*Speed* Access your favorite newsgroups from home or on the road ----------------- If it has to do with the "wi...

cpu time
Hi, Can you tell me about good tool for vs-6 that can tell me what functions in my application take the most cpu time? Thanks! In article <u$YZa3o9EHA.2680@TK2MSFTNGP09.phx.gbl>, dbg@012.net.il says... > Hi, > Can you tell me about good tool for vs-6 that can tell me what functions in > my application take the most cpu time? VS 6 includes a perfectly good profiler, which does exactly this. If you're working inside the environment, go to the link tab in the project settings, and click the "enable profiling" check box, then do a 'rebuild all' to gene...

Time Out a MsgBox
I have a file that runs a macro when it is open. This file may be opened manually or automatically by a macro from another file. If the file is opened manually I would like a MsgBox to prompt the user to end the macro before it gets into the body of the code. If the file is opened automatically I would like the MsgBox to automatically respond after a time delay to allow the macro to continue running the bulk of the code. Is there anyway to force a response to a MsgBox after a preset amount of time with no response from the user? Hi, How about this instead which closes...

Histogram #2
Hi, Is there anyway to link a histogram with another variable i.e. I have a histogram of the count of customers that fall in certain ranges. I also want to put the total revenue associated with those customers for each range on the chart. Is thta possible? Tks - Saad On Thu, 6 Nov 2003 09:54:23 -0800, Saad <anonymous@discussions.microsoft.com> wrote: > Hi, > > Is there anyway to link a histogram with another variable > i.e. I have a histogram of the count of customers that > fall in certain ranges. I also want to put the total > revenue associated with those cu...

OWA question #2
We currently use OWA 2000 at my office for some remote users as well as some internal users. I'm having trouble getting access to some of the users (can't get the domain\username right). I've changed my settings to Basic authentication which I'm running on our SSL site. I also changed the Basic Authenticaion Domain to ours. But my real concern is the security of it all. Is that secure enough? Thanks for any help you are able to provide Will "Auddog" <will_k@hotmail.com> wrote in message news:%23faF$0c6DHA.2472@TK2MSFTNGP10.phx.gbl... > We currently ...

OE 6.0 #2
Does anyone out there now OE's error message, '0x800cccf0'? I have had to reintall my operating system. I want to use OE to retrieve my hotmail messages and I and I am having trouble setting up the Outlook account. The error message, 0x800cccf0, is something I know nothing about. Can someone out there help walk me through this? I have asked for support from MSN but they cannot clear up the issue. Thomas Ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the ...

Calculating time and pay in excel
Hi, i'm trying to make a spreadsheet that can calculate pay per minute depending on an average length of time worked. Its driving me crazy and any help would be greatly appreciated! Coloumn A is length of time, at the bottom is a total time, next to that is an average length of time worked and this is then multiplied by the amount appropriate for that average. What would be the best way to work all of this out accurately? Many thanks for any help you can give Mark -- wobbleman ------------------------------------------------------------------------ wobbleman's Profile: http://www.e...

Am I behind the times?
I have just installed Exchange sp2 on my SBS 2008 boxes and all went well. One weird thing at the end of one of the installs it said Web Apps (I think) couldn't restore default configuration, but everything seems to be working just fine. So then I went to look for updates and I see a few that I must have missed. I use WSUS on the network. One is Exchange SP2 update rollup 3. Go for it or no? Second, Windows Server 2008 SP2. Yikes, when did that come out for SBS? I wonder why it never popped up before since it looks like it's been out for quite some time. Nonetheless, s...

test post #2
-- jgt ...

run time error
When I attempt to import a text file (.txt) in to Access, an error occurs. Run-time error �3163�: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data When I click the Debug button this pops up: .Fields("TranType").Value = rs("MoveType").Value A different error occurs when save it to my desktop, and this is what happens.Run-time error �2185�: You can�t reference a property or method for a control unless the control has the focus. When I click the Debug button this pops up: MsgBox "Import File Not Found:&quo...

Start Time & End Time
I have a table of data for my Scheduled cutting list that is exported from another program into an Excel Spreadsheet and from this table I would like to be able to find the start and end time of the production runs automatically in a separate table. The table is set up like this Planned order Time Product Description Volume 12345 08:00:00 Product 1 3500 23435 11:32:00 Product 2 5680 14567 13:24:00 Product 3 10000 and so on. I can find the start time by us...

HELP #2
I recently cleaned my hard drive to the bone and reinstalled everything on my Windows 98SE computer. Now when I run Publisher 2000, after about 15 seconds up pops a window that says, "There was a problem starting the Office Assistant. Would you like to try reinstalling it?" I have the stand alone version of Publisher 2000. I've tried the "Repair" option without success. Isn't the Ofc Asst the paper clip in Word? I have Word 97. Anyone know the fix? -- Don -------- Vancouver, USA - One of the great cities in one of the 45+ countries in America! OFF2000: &q...

Incorrect Time Stamps
Exchange seems to be stamping the wrong time on emails and events sporadically. All the times on servers are correct. Any thoughts? -- Craig Tuttle - Level I Exchange Tech UCNSB.org The time stamp can also be handled by the client. Which exact time field is being stamped wrong? Have you verified that the client has the correct time (i.e. Daylight savings time set correctly)? -- Ben Winzenz Exchange MVP MessageOne "Craig Tuttle" <CraigTuttle@discussions.microsoft.com> wrote in message news:02D51926-77DC-43EB-A5B5-7A00F4530323@microsoft.com... > Exchange seems to b...

Hide Formula Results #2
Here I go again. LOL! I know this probably has a very simple solution and I am just not able to make myself clear on what it is I'm trying to accomplish. Think checkbook scenario. Okay, this is basically it. What I want is for it not to show the total all the way down if there have been no debits or credits posted on that row. A B C D E 1 2 Balance 1000.00 3 4 Desc Debit Credit Balance 5 2.00 998.00 6 5.00 1003.00 7 1003.00 8 1003.00 9 1003.00 10 1003.00 The Account balance is shown in cell E3, so...

Exchange Migration Wizard #2
I think the answer is yes and yes, but just want to clarify. Can I use the Exchange Migration Wizard to move mailboxes from an Exchange 2000 Server in one domain, Exchange Org to an Exchange 2003 server in a separate domain, Exchange Org? When I run it, it will create an appropriate AD account and move the mailbox? ...

Transferring freight more than one time on a sales order
We frequently have partial shipments of sales orders and we leave the sales order open until everything has shipped instead of creating backorders. The system will allow you to have several tracking numbers for each order but you can only transfer the freight once. I would like to make the suggestion to be able to transfer freight more than one time. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, ...

Create address list based on the Group Membership of user
Hello ! In exchange 2003 was posiible to create an address list based on the Group Membership of user as article ID 321723 in KB Microsoft describes. We are trying to do the same on Exch 2007. How can we do this using Opath syntax ? What exactely is the command for the dynamic custom filtering? Thank you very much Paolo & Corrado memberOf Attribute can now be used in OPATH filters! http://exchangepedia.com/blog/2007/02/memberof-attribute-can-now-be-used-in.html -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: exchangepedia.com/blog ------------------------------...

How chart time scale x-axis with another date serie
Hello all. I have this problem, I will need to create this chart that I don't know how to. Serie 1 is below which needs to be time scaled Date Count 1/1/2006 12 1/2/2006 3 1/3/2006 5 2/1/2006 18 2/3/2006 4 2/18/2006 9 4/1/2006 18 7/4/2006 38 Serie 2 - needs to plot the three dates in serie 1's time scaled X-Axis with symbols. 1/31/2006 2/18/2006 4/2/2006 I will look something like you have a line of count on a time-scaled chart, with 3 dates point in the x-axis. Please ...