View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default MsgBox to display [hh]:mm

Try this

wtime = ActiveCell.Value
MsgBox ("You worked for " & Format(wtime, "hh:mm") & " Hrs:Min")

The cell's format isn't part of the value you are storing in wtime, so you
have to format it in the messagebox also.

Hope this helps,

Hutch

"learner" wrote:

Trying to finish up the macro with this message box

wtime=ActiveCell.Value
MsgBox("You worked for " & wtime & "Hrs:Min")

Cell where the value is taken from contains formula, is formatted as [hh]:mm
and is displayed right. But when I try to use the value in the message box, I
get something like 9.12435E-3.

It's gotta be simple but I can't figure it out.
Thank you