Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a text box control on a form whose control source is a time (e.g.00:00)
Displayed in the text box I get the time as a decimal ((0.375) but want it displayed as the time. Can someone tell me how to format the control to do this? All help appreciated |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use something like
TextBox1.Value = Format$(YourTime, "hh:mm") -- Regards Juan Pablo González "patrick" wrote in message ... I have a text box control on a form whose control source is a time (e.g.00:00) Displayed in the text box I get the time as a decimal ((0.375) but want it displayed as the time. Can someone tell me how to format the control to do this? All help appreciated |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Patrick,
Try something like: TextBox1.Value = Strings.Format(mytime, "hh:mm:ss AM/PM") where mytime is your time number. Regards, Sebastien "patrick" wrote: I have a text box control on a form whose control source is a time (e.g.00:00) Displayed in the text box I get the time as a decimal ((0.375) but want it displayed as the time. Can someone tell me how to format the control to do this? All help appreciated |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Patrick,
If you have linked the textbox to the cell useing ControlSource, you will need to remove that and load the text box explicitly, like Textbox1.Text = Worksheets("Sheet1").Range("A1").Text if the cell is already formatted, or Textbox1.Text = Fomat(Worksheets("Sheet1").Range("A1").Value,"hh:m m") if it is not formatted -- HTH RP (remove nothere from the email address if mailing direct) "patrick" wrote in message ... I have a text box control on a form whose control source is a time (e.g.00:00) Displayed in the text box I get the time as a decimal ((0.375) but want it displayed as the time. Can someone tell me how to format the control to do this? All help appreciated |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display text source in multiple sheets | Excel Worksheet Functions | |||
Date time control does not display correctly | Excel Discussion (Misc queries) | |||
Why does Custom Format not control Cell Display? | Excel Discussion (Misc queries) | |||
Text boxes and control source | Excel Programming | |||
Text Box Control Source | Excel Programming |