Solved How to format this cell?

KitaYama

Well-known member
Local time
Tomorrow, 07:00
Joined
Jan 6, 2022
Messages
2,095
I'm trying to format a cell to add POS to the first of the typed value and keep the leading zeros.

Input value by userResult
0125POS0125
003265POS003265
326POS326
00003POS00003

It means if I type 0125, I want it to be converted to POS0125

I've changed the format of the cell to the following, but none of them gives me the desired result.
"POS" 000000000000
"POS" ###########

Any kind of advice is much appreciated.
 
PO\S#

or

\P\O\S#
 
For me, using @ didn't work - ???
if there is already data, it will not work, but if you re-type, you will see.
you can also Format the cells As Text first before formatting the cells.
 
PO\S#

or

\P\O\S#
Seems that Excel doesn't like this format

2022-07-29_21-21-38.png
 
why the error?
@arnelgp thanks for the video. But as I said, Excel doesn't accept that format. You can see the image I posted above.
It may have something with reginal settings.

Is there any way to do it in worksheet-OnChange event ? (for the whole C column)

thanks.
 
Million thanks.
The format in your demo is PO!S@ (It's different with what you posted in #4)


I wish I had asked sooner. I wasted the whole day on this and couldn't solve the problem.
You did it in less than a minute.
I don't know how to thank you.
Million thanks.
 
I guess the escape character for your regional variation is ! Instead of \

When you opened Arne's demo Access translated it for you.
 
As I had guessed, there's something wrong with reginal settings. Even if I copy-paste @arnelgp's format, Excel doesn't accept it.
I try to do it with a function in worksheet-onchange event.

Thanks to both of you.
 

Users who are viewing this thread

Back
Top Bottom