View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default 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