ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting Question (https://www.excelbanter.com/excel-programming/345751-formatting-question.html)

Thomas L[_2_]

Formatting Question
 
I am drawing a blank and need some help. I need to format a textbox after
it's been updated to the format XXX9999-999. The X's are either Letters or
Numbers and are required, the 9's are any number 0-9. I know how to write
the format, however I don't know how to format the X portion to accept either
Letters or numbers.

Tom Ogilvy

Formatting Question
 
Textbox.Text = Left(Textbox.Text,7) & "-" & Right(Textbox.Text,3)

Data in a textbox is string data and you can't "format" string data.

If it is all numeric, then it would be coerced to a number in the format
command, but as you say, if alpha-numeric, this doesn't work.

--
Regards,
Tom Ogilvy


"Thomas L" wrote in message
...
I am drawing a blank and need some help. I need to format a textbox after
it's been updated to the format XXX9999-999. The X's are either Letters

or
Numbers and are required, the 9's are any number 0-9. I know how to write
the format, however I don't know how to format the X portion to accept

either
Letters or numbers.





All times are GMT +1. The time now is 02:29 AM.

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