ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Formatting (https://www.excelbanter.com/excel-worksheet-functions/19836-conditional-formatting.html)

[email protected]

Conditional Formatting
 
I want to create a workbook, in which I will key in 1 and that particular
cell will be converted to X with red back ground. Is this possible should I
use conditional formating or Need to put some formula with true/false

JulieD

Hi

if you want to convert the value from 1 to X then you'ld need to use a
worksheet_change event macro e.g.

---
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" And Target.Value = 1 Then
Target.Value = "X"
Target.Interior.ColorIndex = 3
ElseIf Target.Address = "$A$1" Then
Target.Interior.ColorIndex = xlNone
End If
End Sub
---

to use the code, right mouse click on the sheet you want to do this in and
choose view code, copy & paste the code directly into the white area on the
right, changing $A$1 to your actual cell reference.

To test, choose ALT & F11 to switch back to the workbook and type 1 into the
cell.

Cheers
JulieD

" wrote in
message ...
I want to create a workbook, in which I will key in 1 and that particular
cell will be converted to X with red back ground. Is this possible should
I
use conditional formating or Need to put some formula with true/false





All times are GMT +1. The time now is 05:22 AM.

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