Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 29th, 2007, 01:24 AM
Registered User
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to display the time(running time) in Excel

Hi All,

       I need the VBA code to display the time in Excel.I used the "Time" function but it is not showing the running time.It is showing the fixed time i.e., The Time when we compiled the code but i want the dynamic time i.e., The Time must be updating for every second (Running or Dynamic Time).
               Plz anybody help me in this regard.
                                                   Thank you:)
Old March 29th, 2007, 01:56 AM
Friend of Wrox
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts

Add a Timer Control to your form and set the timer interval.

In the Timer event for that timer set (refresh) the time

Private Sub Timer1_Timer()

    Label1.Caption = Date & " " & Time

End Sub

Private Sub UserForm_Initialize()
 Timer1.Interval = 1000
End Sub



Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Shift time in minus time out lechalas Beginning VB 6 1 August 11th, 2008 01:56 PM
display server time arabuafef Classic ASP Basics 1 March 18th, 2007 06:16 PM
Running queries at a time Amitava Deewan Oracle 1 March 19th, 2005 12:18 PM
Display time on the report rajanikrishna Crystal Reports 0 March 11th, 2005 06:17 AM
Display Continuous Time mjwelker VB.NET 2002/2003 Basics 1 May 4th, 2004 08:31 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.