ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   format time in messsage box (https://www.excelbanter.com/excel-programming/371216-format-time-messsage-box.html)

Rich

format time in messsage box
 
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


NickHK

format time in messsage box
 
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

"Rich" wrote in message
...
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

format time in messsage box
 
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

"NickHK" wrote:

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

"Rich" wrote in message
...
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





NickHK

format time in messsage box
 
Rich,
OK, I was just going by your subject line.

NickHK

"Rich" wrote in message
...
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

"NickHK" wrote:

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

"Rich" wrote in message
...
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








All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com