Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I want to accomplish two key objectives. The first and foremost is: Have a VB Script conditionally format cells based on their contents. I would like to have the script do: If ŒY¹ or Œy¹ entered into the cells the fill color becomes Green If ŒN¹ or Œn¹ is entered into the cells the fill color becomes Red If ŒV¹ or Œv¹ or ŒVacation¹ is entered into the cell the fill color becomes light green If ŒNFT¹ or Œnft¹ is entered into the cell the fill color becomes another color This would work for the entire workbook I may even want to change or bold the font. I have looked at a number of scripts but have not had ay luck. The next script I would like to add is that if ay of the information above is entered into the cell, the case is changed to uppercase. Any and all help is appreciated. Thank You, Rod |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Rod,
Try this code for color changing. private sub .. range("A1:D10").Select Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""R""" Selection.FormatConditions(1).Interior.ColorIndex = 3 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""G""" Selection.FormatConditions(2).Interior.ColorIndex = 50 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""B""" Selection.FormatConditions(3).Interior.ColorIndex = 5 end sub regards KarthiGanesh "Rod Cohen" wrote: Hello, I want to accomplish two key objectives. The first and foremost is: Have a VB Script conditionally format cells based on their contents. I would like to have the script do: If ŒY¹ or Œy¹ entered into the cells the fill color becomes Green If ŒN¹ or Œn¹ is entered into the cells the fill color becomes Red If ŒV¹ or Œv¹ or ŒVacation¹ is entered into the cell the fill color becomes light green If ŒNFT¹ or Œnft¹ is entered into the cell the fill color becomes another color This would work for the entire workbook I may even want to change or bold the font. I have looked at a number of scripts but have not had ay luck. The next script I would like to add is that if ay of the information above is entered into the cell, the case is changed to uppercase. Any and all help is appreciated. Thank You, Rod |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
conditional formatting of cells | Excel Worksheet Functions | |||
conditional formatting + VBscript | Excel Discussion (Misc queries) | |||
Conditional Formatting Cells | Excel Programming | |||
Conditional Formatting Multiple cells based on 2 cells | Excel Worksheet Functions |