ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Autoformat/Conditional Format of entered Number (https://www.excelbanter.com/excel-discussion-misc-queries/235844-autoformat-conditional-format-entered-number.html)

TheBusMan

Autoformat/Conditional Format of entered Number
 
I am trying to conditional format a cell based on the total digits entered.

If I was to enter a single digit, say a '4', I would want the cell to show
'004'
If I was to enter a double digit, say a '12', I would want the cell to show
'012'
If I was to enter a triple digit, say a '351', I would want the cell to show
just '351'

I know how to do it manually, but am at a loss about autoformat/conditional
formating.

Mike H

Autoformat/Conditional Format of entered Number
 
Hi,

You would use cell formatting for that. Select your cell(s) and then

Format|Cells - Custom
Apply a custom format of 000
Mike

"TheBusMan" wrote:

I am trying to conditional format a cell based on the total digits entered.

If I was to enter a single digit, say a '4', I would want the cell to show
'004'
If I was to enter a double digit, say a '12', I would want the cell to show
'012'
If I was to enter a triple digit, say a '351', I would want the cell to show
just '351'

I know how to do it manually, but am at a loss about autoformat/conditional
formating.


TheBusMan

Autoformat/Conditional Format of entered Number
 
I forgot to include that that there is some additional information that is
displayed. Once I enter '4', it reformats to show the following:

'2009-#' I want it to show '2009-###' It will eventually result in 3 digit
numbers, but I don't want to be going in to alter the formatting all the time
if I don't have to.

Also, if I enter '004' regardless of the formatting, it kicks out the '00'
and leaves the '4'.

"Mike H" wrote:

Hi,

You would use cell formatting for that. Select your cell(s) and then

Format|Cells - Custom
Apply a custom format of 000
Mike

"TheBusMan" wrote:

I am trying to conditional format a cell based on the total digits entered.

If I was to enter a single digit, say a '4', I would want the cell to show
'004'
If I was to enter a double digit, say a '12', I would want the cell to show
'012'
If I was to enter a triple digit, say a '351', I would want the cell to show
just '351'

I know how to do it manually, but am at a loss about autoformat/conditional
formating.



All times are GMT +1. The time now is 08:31 PM.

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