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

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

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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