![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello, Is it possible to convert a time to text Example : 12:20:00 ---> 12 h 20 (texte format) I know the procedure =TEXT ... Is there something but in vba? Thanks for your help. Yves |
| Ads |
|
#2
|
|||
|
|||
|
> Is it possible to convert a time to text
> > Example : 12:20:00 ---> 12 h 20 (texte format) > > I know the procedure =TEXT ... > Is there something but in vba? You can use the Format function in VBA... YourTimeValue = #12:20:00# MsgBox Format(YourTimeValue, "h \h mm") Rick Rothstein (MVP - Excel) |
|
#3
|
|||
|
|||
|
"If" > wrote:
> Is it possible to convert a time to text > Example : 12:20:00 ---> 12 h 20 (texte format) > I know the procedure =TEXT ... > Is there something but in vba? The VBA Format function is similar to the Excel TEXT function. For example: Const d As Double = #12:20:00 PM# MsgBox Format(d, "h \h m") If 12:20:00 is in A1 (formatted any way you wish), you could also do: =TEXT(A1, "h \h m") And you can do: =A1 with the Custom format "h \h m" without quotes. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert time to text | Jacqueline | Excel Worksheet Functions | 5 | August 4th 09 06:35 PM |
| How do I convert time as text 'mm:ss to time value in Excel | Sholto | Excel Discussion (Misc queries) | 5 | April 1st 09 05:40 AM |
| convert time to text | checkQ | Excel Discussion (Misc queries) | 9 | May 11th 07 08:31 PM |
| Convert Text Time to Excel Time | [email protected] | Excel Discussion (Misc queries) | 5 | January 29th 07 04:43 PM |
| convert time imported as text to time format for calculations | batfish | Excel Worksheet Functions | 3 | October 27th 05 11:24 PM |