ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting userform textbox - help required (https://www.excelbanter.com/excel-programming/290513-formatting-userform-textbox-help-required.html)

Kennyatwork

Formatting userform textbox - help required
 
Hello All

I have created a command button which when clicked enters the date and time
into a textbox on my userform by using a sub - TextBox1.value=Now()

My problem is it enters in M/D/YYYY_H:M:S format and, being British, I
require D/M/YYYY_H:M:S format.

As I could not find a way of altering the date property of the text box I
attempted to add TextBox1.Format=D/M/Y_H:M:S into my sub but this only
created an error!

Could someone please advise on the correct method of acheiving what I
equire

TIA

Kenny



Bob Phillips[_6_]

Formatting userform textbox - help required
 
Kenny,

Try

TextBox1.value=Format(Now(),"D/M/YYYY_H:M:S")

--

HTH

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

"Kennyatwork" wrote in message
...
Hello All

I have created a command button which when clicked enters the date and

time
into a textbox on my userform by using a sub - TextBox1.value=Now()

My problem is it enters in M/D/YYYY_H:M:S format and, being British, I
require D/M/YYYY_H:M:S format.

As I could not find a way of altering the date property of the text box I
attempted to add TextBox1.Format=D/M/Y_H:M:S into my sub but this only
created an error!

Could someone please advise on the correct method of acheiving what I
equire

TIA

Kenny





Kennyatwork

Formatting userform textbox - help required
 
Thanks - works a treat!

"Kennyatwork" wrote in message
...
Hello All

I have created a command button which when clicked enters the date and

time
into a textbox on my userform by using a sub - TextBox1.value=Now()

My problem is it enters in M/D/YYYY_H:M:S format and, being British, I
require D/M/YYYY_H:M:S format.

As I could not find a way of altering the date property of the text box I
attempted to add TextBox1.Format=D/M/Y_H:M:S into my sub but this only
created an error!

Could someone please advise on the correct method of acheiving what I
equire

TIA

Kenny





Bob Phillips[_6_]

Formatting userform textbox - help required
 
Good, should be Kennyathome soon.

--

HTH

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

"Kennyatwork" wrote in message
...
Thanks - works a treat!

"Kennyatwork" wrote in message
...
Hello All

I have created a command button which when clicked enters the date and

time
into a textbox on my userform by using a sub - TextBox1.value=Now()

My problem is it enters in M/D/YYYY_H:M:S format and, being British, I
require D/M/YYYY_H:M:S format.

As I could not find a way of altering the date property of the text box

I
attempted to add TextBox1.Format=D/M/Y_H:M:S into my sub but this only
created an error!

Could someone please advise on the correct method of acheiving what I
equire

TIA

Kenny








All times are GMT +1. The time now is 08:15 PM.

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