Number Format (custom)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want a custom type that will take '5W' and put a zero in front, making it
'05W'. I used the 00 custom type and it would turn 5 into 05. I got a reply
to an earlier post suggesting to use "0"@. This worked but I forgot to
mention that if 05W or 15W was entered I want it left alone. "0"@ added the
zero to the beginning turning it into 005W or 015W.
 
No real way to build logic into a number format in excel.

in a number format you tell it what you want a positive number to look like,
a negative number, zero and text.
 
I want a custom type that will take '5W' and put a zero in front, making it
'05W'. I used the 00 custom type and it would turn 5 into 05. I got a reply
to an earlier post suggesting to use "0"@. This worked but I forgot to
mention that if 05W or 15W was entered I want it left alone. "0"@ added the
zero to the beginning turning it into 005W or 015W.

If the prefix will always be a "W", you could just enter the number, and use
the custom format:

"00W" (without the quote marks)

Otherwise, you will likely need a VBA event triggered macro so will have to
supply more information.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top