format time in messsage box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

part of the code i am using in a macro is as follows

Dim timedue As String

timedue = "c" & rowAddress

reg = InputBox("" & Range(locatetrunk) & " Due On Site At :-" &
Range(timedue).NumberFormat = "hh:mm"& Chr$(13)

what i am hoping for is a way to display the "time" as a time in the message
box that appears when the macro is activated but cant find a way to "format"
the text
 
Rich,
You would normally use :
Format(<Value>,"hh:mm")

Also I assume the InputBox is a typo and you mean MsgBox
Maybe:
reg = MsgBox(Range(locatetrunk).Value & " Due On Site At :-" &
Format(Range(timedue).Value, "hh:mm"))

NickHK
 
thanks for that it works fine

no not a typo, the message is part of a imputbox , and is used to give the
DUE time of a item with a imput option to put a reason why it was late

thanks

Rich
 

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

Back
Top