Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default How do I format a text box control to display the source in time .

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default How do I format a text box control to display the source in time .

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default How do I format a text box control to display the source in time .

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How do I format a text box control to display the source in time .

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display text source in multiple sheets Nic Daniels Excel Worksheet Functions 1 July 28th 09 03:00 PM
Date time control does not display correctly paros789 Excel Discussion (Misc queries) 0 April 7th 09 01:39 PM
Why does Custom Format not control Cell Display? Dennis Excel Discussion (Misc queries) 1 June 11th 05 12:28 AM
Text boxes and control source Welshy[_4_] Excel Programming 1 November 18th 04 12:40 PM
Text Box Control Source Richard Excel Programming 6 May 17th 04 02:17 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"