Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Format(3.767, "[hh]:mm")
On a worksheet cell, value = 3.767 and formatted "[hh]:mm"
I get 90:23 (90 hours and 23 mins) I want to return "90:23" with VBA but I get ":01" When i try MsgBox Format(3.767, "hh:mm") - no square brackets I get "18:24" (the remaining hours over a multiple of 24 as expected) Any advice will be appreciated |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Format(3.767, "[hh]:mm")
Hi,
Try this myval = 3.767 MsgBox WorksheetFunction.Text(myval, "[hh]:mm") Mike "David" wrote: On a worksheet cell, value = 3.767 and formatted "[hh]:mm" I get 90:23 (90 hours and 23 mins) I want to return "90:23" with VBA but I get ":01" When i try MsgBox Format(3.767, "hh:mm") - no square brackets I get "18:24" (the remaining hours over a multiple of 24 as expected) Any advice will be appreciated |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Format(3.767, "[hh]:mm")
Thanks Mike, worked a treat
"Mike H" wrote: Hi, Try this myval = 3.767 MsgBox WorksheetFunction.Text(myval, "[hh]:mm") Mike "David" wrote: On a worksheet cell, value = 3.767 and formatted "[hh]:mm" I get 90:23 (90 hours and 23 mins) I want to return "90:23" with VBA but I get ":01" When i try MsgBox Format(3.767, "hh:mm") - no square brackets I get "18:24" (the remaining hours over a multiple of 24 as expected) Any advice will be appreciated |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MsgBox "Choose one ", vbYesNoCancel, " Three Options. " | Excel Programming | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Excel VBA to convert "dd.MM.yy" text to "dd/MM/yyyy" format date? | Excel Programming | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
Changing format of column from "general" to "currency" | Excel Programming |