Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perceived Question:
I need to set a constant to a specific value (the string "IN") in a specific column. I am working with conditional formatting and one of the conditions is if the constant is "IN" then the formatting will take place, else no formatting. Here's what I have so far: Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _ Formula1:=s_current, Formula2:=s_future Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:= CONSTANT THAT EQUALS "IN" Selection.FormatConditions(1).Interior.ColorIndex = 3 Where I place CONSTANT THAT EQUALS "IN" is, obviously, the value in the specific column. I hope I am making myself clear and need help badly. I appreciate any time and consideration you may provide. As usual, I always get help from you guys/gals!!! Thanks, -m |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I understand your question then you wish to test a condition based on a
value (Constant) within your code. You could use the following, clearly the value of xConst will always be TRUE in this method, but if some other code you have is changing this value then referencing the value set works OK ' declare this in your set up module Public xConst As String xConst = "IN" ' your code to set conditions on sheet Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _ Formula1:=s_current, Formula2:=s_future Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:=xConst Selection.FormatConditions(1).Interior.ColorIndex = 3 -- Cheers Nigel "mvyvoda" wrote in message ... Perceived Question: I need to set a constant to a specific value (the string "IN") in a specific column. I am working with conditional formatting and one of the conditions is if the constant is "IN" then the formatting will take place, else no formatting. Here's what I have so far: Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _ Formula1:=s_current, Formula2:=s_future Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:= CONSTANT THAT EQUALS "IN" Selection.FormatConditions(1).Interior.ColorIndex = 3 Where I place CONSTANT THAT EQUALS "IN" is, obviously, the value in the specific column. I hope I am making myself clear and need help badly. I appreciate any time and consideration you may provide. As usual, I always get help from you guys/gals!!! Thanks, -m |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change Selection to specific Range | Excel Discussion (Misc queries) | |||
Selection of specific cells | Excel Discussion (Misc queries) | |||
How to set the entire selection to a specific value without using VBA | Excel Programming | |||
Specific datapoints selection | Charts and Charting in Excel | |||
specific data selection/pasting | Excel Discussion (Misc queries) |