Format Msgbox - time HH:mm

H

Hennie Neuhoff

I want the messagebox to display the time formatted hh:mm
I've played around with the following, without any joy!
msgbox "The starting time is:" & Val(Range("stime")) & Format (stime,"hh:mm")
Where do I go wrong?
 
M

Mike H

Hi,

I assume 'Stime" is a named range on the worksheet that contains a time. Try
this

MsgBox "The starting time is:" & Format(Range("Stime"), "hh:mm")

Mike
 
R

RyanH

Make sure that your range "stime" is not several cells. If so this will not
work. So I assume stime is a singel cell:

MsgBox "The starting time is: " & Format (Range("stime").Value,"hh:mm")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top