real time function in a form

bigdazzer

New Member
Joined
Jan 29, 2003
Messages
5
hi all

i am currently using this =DateAdd("n",-30,Now()) to display time zones on a map of australia this returns the current time when the form is opened however the form can only change the time when the form is refreshed. What i am trying to achieve is a time function in real time that shows hours minutes and seconds which i will place on my master form. Why i hear you ask because im to lazy to look at the clock in the system tray and i want to know if it can be done? :D
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Use the forms On Timer Event to refresh

Hi,

Use your forms On Timer Event to refresh you clock display. Remember this is going to eat CPU cycles each and every time it fires. You have been warned!
 
Upvote 0
Try this function.

Function ChangeCaption()

Dim i As Integer

For i = 0 To Forms.Count - 1

Forms(i).Caption = Format(Now, "dddd,mmm d yyyy,hh:mm:ss AMPM")

Next i

End Function

Then call the function from the Timer event of the form.


David
 
Upvote 0

Forum statistics

Threads
1,221,499
Messages
6,160,169
Members
451,629
Latest member
MNexcelguy19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top