![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 11:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com