Please help Userform TextBox1 format appear in hh:mm:ss AM/PM format.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,

Please help. Below is my current code.
I want the TextBox1 to show time format in hh:mm:ss AM/PM format.
When i run the it show in general number format.
Thanks


Code:
Private Sub TextBox1_Change()
  TextBox1.Value = Range("DigitalClock").Value
End Sub
 
If the clock is 'ticking' on the worksheet there is probably code that is doing that.

If you want it to also 'tick' on the userform you could add to that code to update the textbox.

Mind you it depends on what code is being used to update the clock, and if that's what you really want to do.

The code for the update might actually be using some sort of on time event and could possibly interfere with any other code in the worksheet.

If you were to add to it to update the userform you might also need to repaint the userform to see anything actually happen.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,216,091
Messages
6,128,775
Members
449,468
Latest member
AGreen17

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