ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform format question (https://www.excelbanter.com/excel-programming/298597-userform-format-question.html)

Martha[_2_]

Userform format question
 
Hi,

I would like to display the current time in either a label
or textbox. Could you please advise how to format.

Thanks a bunch,

Martha

mark

Userform format question
 
Hi Martha,

Try this.

lblTime.Caption & Format(Time, "hh:mm AM/PM")


-----Original Message-----
Hi,

I would like to display the current time in either a

label
or textbox. Could you please advise how to format.

Thanks a bunch,

Martha
.


Bob Phillips[_6_]

Userform format question
 
I think you mean

lblTime.Caption = Format(Time, "hh:mm AM/PM")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"mark" wrote in message
...
Hi Martha,

Try this.

lblTime.Caption & Format(Time, "hh:mm AM/PM")


-----Original Message-----
Hi,

I would like to display the current time in either a

label
or textbox. Could you please advise how to format.

Thanks a bunch,

Martha
.




Martha[_2_]

Userform format question
 
It doesn't like the "&" but wotrks with "="

Thank you very much.


-----Original Message-----
Hi Martha,

Try this.

lblTime.Caption & Format(Time, "hh:mm AM/PM")


-----Original Message-----
Hi,

I would like to display the current time in either a

label
or textbox. Could you please advise how to format.

Thanks a bunch,

Martha
.

.


mark

Userform format question
 
It doesn't like the "&" but wotrks with "="

oops... sorry.

I copied that out of something I have here... in my case,
I wanted it to append the time to the existing caption...
therefore the &

But for you, yep... =

Glad you got it working.

Mark

mark

Userform format question
 
yep, that was it.

I went into one of my applications to be reminded of the
exact positioning of the AM/PM part, and forgot to edit
the post appropriately.

Oops.

-----Original Message-----
I think you mean

lblTime.Caption = Format(Time, "hh:mm AM/PM")





All times are GMT +1. The time now is 01:33 AM.

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