SOLVED

cell formating

Copper Contributor

Hello,

I fill in cell with code like that:

- 6 digits

or

- 6 digits + *

I want to type it like for exemple 011008 and have a result like that 01 10 08

Until now I use the cell formating 0# ## ##....and it works.

 

But if i use the 6 digits + "*" like for exemple 011008*...I obtain this result  011008*.

And I would like to obtain 01 10 08*.

I have tried many formaat (0# ## ###, ...etc...)...unsuccessful

 

I would like to know if there is a solution to obtain a formaat which accept both (with or without *)

 

Can anybody help me?

Thx

4 Replies

Hi 

If you want to use * in creating custom format, you should you use \ before it.

So try this format:  0# ## ## ##\* 

@Jihad Al-Jarady 
Thx

but this format give me always the *
I would like to have the choice to type:

010101 and obtain 01 01 01

Or

010101* and obtain 01 01 01*

In your format I obtain always 01 01 01* 

best response confirmed by Nicolas1313 (Copper Contributor)
Solution

@Nicolas1313 

With 6 digits only you have a number, apply to it custom number format and it works.

6 digits with asterisk it text, not number, and custom number format doesn't work with texts (more exactly can't format them same way as numbers).

 

That's to use formula and put desired result into another column or use VBA.

@Sergei Baklan 

Thx for your answer

1 best response

Accepted Solutions
best response confirmed by Nicolas1313 (Copper Contributor)
Solution

@Nicolas1313 

With 6 digits only you have a number, apply to it custom number format and it works.

6 digits with asterisk it text, not number, and custom number format doesn't work with texts (more exactly can't format them same way as numbers).

 

That's to use formula and put desired result into another column or use VBA.

View solution in original post