ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextBox Formatting (https://www.excelbanter.com/excel-programming/294457-textbox-formatting.html)

ToddG[_2_]

TextBox Formatting
 
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like this
textbox to keep this format at all times - after a value
is entered AND when the userform is activated. Where would
I place this code and what declaration would be used?

TIA

Bob Phillips[_6_]

TextBox Formatting
 

Private Sub TextBox1_AfterUpdate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

Private Sub UserForm_Activate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

--

HTH

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

"ToddG" wrote in message
...
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like this
textbox to keep this format at all times - after a value
is entered AND when the userform is activated. Where would
I place this code and what declaration would be used?

TIA




ToddG[_2_]

TextBox Formatting
 
Thanks for your reply Bob

UserForm_Activate still isn't working. The next time the
userform is displayed it goes back to its standard format.

Also, there are quite a few textboxes in this userform in
various frames in a multipage. Is there a better way to
apply this format to all of them?
-----Original Message-----

Private Sub TextBox1_AfterUpdate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

Private Sub UserForm_Activate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

--

HTH

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

"ToddG" wrote in message
...
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like this
textbox to keep this format at all times - after a value
is entered AND when the userform is activated. Where

would
I place this code and what declaration would be used?

TIA



.


Bob Phillips[_6_]

TextBox Formatting
 
If you unload the form, all objects will re-initialise the next time you
show the form.

--

HTH

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

"ToddG" wrote in message
...
Thanks for your reply Bob

UserForm_Activate still isn't working. The next time the
userform is displayed it goes back to its standard format.

Also, there are quite a few textboxes in this userform in
various frames in a multipage. Is there a better way to
apply this format to all of them?
-----Original Message-----

Private Sub TextBox1_AfterUpdate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

Private Sub UserForm_Activate()
TextBox113.Text = Format(TextBox113.Text, "#,##0.00")
End Sub

--

HTH

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

"ToddG" wrote in message
...
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like this
textbox to keep this format at all times - after a value
is entered AND when the userform is activated. Where

would
I place this code and what declaration would be used?

TIA



.




ToddG[_2_]

TextBox Formatting
 
That worked, but only for one textbox. all the others stay
the same. anything i should do differently for multiple
textboxes?

Thanks a lot for your help.
-----Original Message-----
If you unload the form, all objects will re-initialise

the next time you
show the form.

--

HTH

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

"ToddG" wrote in message
...
Thanks for your reply Bob

UserForm_Activate still isn't working. The next time the
userform is displayed it goes back to its standard

format.

Also, there are quite a few textboxes in this userform

in
various frames in a multipage. Is there a better way to
apply this format to all of them?
-----Original Message-----

Private Sub TextBox1_AfterUpdate()
TextBox113.Text = Format

(TextBox113.Text, "#,##0.00")
End Sub

Private Sub UserForm_Activate()
TextBox113.Text = Format

(TextBox113.Text, "#,##0.00")
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"ToddG" wrote in

message
...
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like

this
textbox to keep this format at all times - after a

value
is entered AND when the userform is activated. Where

would
I place this code and what declaration would be used?

TIA


.



.


Bob Phillips[_6_]

TextBox Formatting
 
Only add each one separately in the activate event and have separate
AfterUpdate events for each.

--

HTH

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

"ToddG" wrote in message
...
That worked, but only for one textbox. all the others stay
the same. anything i should do differently for multiple
textboxes?

Thanks a lot for your help.
-----Original Message-----
If you unload the form, all objects will re-initialise

the next time you
show the form.

--

HTH

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

"ToddG" wrote in message
...
Thanks for your reply Bob

UserForm_Activate still isn't working. The next time the
userform is displayed it goes back to its standard

format.

Also, there are quite a few textboxes in this userform

in
various frames in a multipage. Is there a better way to
apply this format to all of them?
-----Original Message-----

Private Sub TextBox1_AfterUpdate()
TextBox113.Text = Format

(TextBox113.Text, "#,##0.00")
End Sub

Private Sub UserForm_Activate()
TextBox113.Text = Format

(TextBox113.Text, "#,##0.00")
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"ToddG" wrote in

message
...
I am formatting the value of a textbox with the code:

TextBox113.Text = Format(TextBox113.Text, "#,##0.00")

This textbox is used to enter a price. I would like

this
textbox to keep this format at all times - after a

value
is entered AND when the userform is activated. Where
would
I place this code and what declaration would be used?

TIA


.



.





All times are GMT +1. The time now is 08:28 AM.

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