ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format cell to display "Y" or "N"when entering a 1 or zero (https://www.excelbanter.com/excel-discussion-misc-queries/129809-format-cell-display-y-n-when-entering-1-zero.html)

Brad

Format cell to display "Y" or "N"when entering a 1 or zero
 
How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?

Don Guillett

Format cell to display "Y" or "N"when entering a 1 or zero
 
You can't. But right click sheet tabview codeinsert this.
Now if you are in the specified range you will get what you want

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("a2:a22")) Is Nothing Then
If Target = 1 Then Target = "Y"
If Target = 0 Then Target = "N"
End If
End Sub

--
Don Guillett
SalesAid Software

"Brad" wrote in message
...
How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?




Toppers

Format cell to display "Y" or "N"when entering a 1 or zero
 
CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?


Brad

Format cell to display "Y" or "N"when entering a 1 or zero
 
Let me clarify further. How do I prevent someone from entering anything
other than a 1 or 0?

In other words, I want a 1 entered so the cell displays a "Y" or I want a 0
entered so the cell displays a "N". All other options should be invalid.

"Toppers" wrote:

CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?


Don Guillett

Format cell to display "Y" or "N"when entering a 1 or zero
 
I just learned a new one but it does Y for anything above 1 also.

--
Don Guillett
SalesAid Software

"Toppers" wrote in message
...
CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?




Toppers

Format cell to display "Y" or "N"when entering a 1 or zero
 
You could use Data Validation with list of 0,1 plus formatting as per
previous reply.

"Brad" wrote:

Let me clarify further. How do I prevent someone from entering anything
other than a 1 or 0?

In other words, I want a 1 entered so the cell displays a "Y" or I want a 0
entered so the cell displays a "N". All other options should be invalid.

"Toppers" wrote:

CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?


Brad

Format cell to display "Y" or "N"when entering a 1 or zero
 
That works. Thanks!

"Toppers" wrote:

You could use Data Validation with list of 0,1 plus formatting as per
previous reply.

"Brad" wrote:

Let me clarify further. How do I prevent someone from entering anything
other than a 1 or 0?

In other words, I want a 1 entered so the cell displays a "Y" or I want a 0
entered so the cell displays a "N". All other options should be invalid.

"Toppers" wrote:

CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?


Gord Dibben

Format cell to display "Y" or "N"when entering a 1 or zero
 
DataValidationAllowWhole Number

Minimum.....0

Maximum.....1

The do the formatting as Toppers suggests.


Gord Dibben MS Excel MVP

On Thu, 8 Feb 2007 09:09:01 -0800, Brad wrote:

Let me clarify further. How do I prevent someone from entering anything
other than a 1 or 0?

In other words, I want a 1 entered so the cell displays a "Y" or I want a 0
entered so the cell displays a "N". All other options should be invalid.

"Toppers" wrote:

CUSTOM format cell as "Y";;"N"

HTH

"Brad" wrote:

How can I format a cell to display a "Y" or "N" when a value of 1 or 0 is
entered?




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

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