Userform Textbox Time Display

DKTRL

Board Regular
Joined
Jul 21, 2013
Messages
153
Dear All

Did anyone know how to format textbox to display time in this manner 00:00 ?

currently i am using a userform to import data from a worksheet. but instead of the time on the worksheet is display 09:00 after import to the userform textbox it became 0.375.

Hope someone can give me a help !


Thanks !
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Excel forms are limited in what they can do. You won't be able to set a time format in the textbox on an excel userform. You will need to format it when populating. So where your code is pulling through the time you can use the format option.

Code:
tb1 = Format(yourtimevalue,"HH:MM")
 
Upvote 0
Excel forms are limited in what they can do. You won't be able to set a time format in the textbox on an excel userform. You will need to format it when populating. So where your code is pulling through the time you can use the format option.

Code:
tb1 = Format(yourtimevalue,"HH:MM")


Dear Brian

Thanks for your respond, i have try a lot format that read from the forums, but non of them is work. and finally got this formula to work .

Thanks


Code:
me.Textbox1.value = Format(Worksheets("sheet1").Range("A1"),"hh:mm")
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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