Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Performing Action On Multiple Values In A Column
I am currently working with a list of test numbers that are stored in column
A. I need the rows to be highlighted red if there is a particular test number in column A. I couple of days ago, there was a forumala that came across that works great for 1 value. However, I need to be able to specify around 10 test numbers. I have tried declaring variables with Dim, modifying the formula below, etc. I can't seem to get anything to work. Anyone have any ideas? Cells.Select Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=$H1=""JOHN SMITH""" Selection.FormatConditions(1).Interior.ColorIndex = 3 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Performing Action On Multiple Values In A Column
If you are looking for numbers, then check out the Choose formula. You
would have to modify the first argument to an expression to return a whole number in the range 1 to 29 for the conditions you want to mark Range("F1:F200").Select Range("F1").Activate Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=CHOOSE(F1,TRUE,,,,,,TRUE,,,,,,TRUE,,,,,TRUE) " Selection.FormatConditions(1).Interior.ColorIndex = 36 There may be alternatives, but more specific details would be needed. -- Regards, Tom Ogilvy "Computer Lady" wrote in message . .. I am currently working with a list of test numbers that are stored in column A. I need the rows to be highlighted red if there is a particular test number in column A. I couple of days ago, there was a forumala that came across that works great for 1 value. However, I need to be able to specify around 10 test numbers. I have tried declaring variables with Dim, modifying the formula below, etc. I can't seem to get anything to work. Anyone have any ideas? Cells.Select Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=$H1=""JOHN SMITH""" Selection.FormatConditions(1).Interior.ColorIndex = 3 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Performing Action On Multiple Values In A Column
Hello, Tom. Thank you for the suggestion. I inserted the values (test
numbers) and I am getting a syntax error and it will not compile. Some additional information on what I am looking for........I have a list of test numbers that go down column A. In column B, it is the test description and in column C it is the number of tests. There are certain test numbers that need to be flagged because they should no longer be utilized. The user has requested that the entire row be highlighted in red if the test number in column A is equal to 0032598, 0078945, 0014792, 0034789, 0099874, and 0037941. Any additional ideas? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Performing Action On Multiple Values In A Column
Sub AddConditional()
Set rng = Range("A1").CurrentRegion.Resize(, 3) ThisWorkbook.Names.Add Name:="List1", RefersTo:= _ "={""0032598"",""0078945"",""0014792""," & _ """0034789"",""0099874"",""0037941""}" rng.Select rng(1).Activate sStr = rng(1).Address(0, 1) Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _ "=NOT(ISERROR(MATCH(" & sStr & ",List1,0)))" Selection.FormatConditions(1).Interior.ColorIndex = 3 End Sub Worked for me. My test numbers were stored as text. -- Regards, Tom Ogilvy "Computer Lady" wrote in message . .. Hello, Tom. Thank you for the suggestion. I inserted the values (test numbers) and I am getting a syntax error and it will not compile. Some additional information on what I am looking for........I have a list of test numbers that go down column A. In column B, it is the test description and in column C it is the number of tests. There are certain test numbers that need to be flagged because they should no longer be utilized. The user has requested that the entire row be highlighted in red if the test number in column A is equal to 0032598, 0078945, 0014792, 0034789, 0099874, and 0037941. Any additional ideas? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Performing Action On Multiple Values In A Column
Your amazing! It worked great. Thanks for your help.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Performing Action on a Range of Rows | Excel Discussion (Misc queries) | |||
Performing Action on a Range of Rows | Excel Discussion (Misc queries) | |||
Performing Multiple Functions in a Column | Excel Worksheet Functions | |||
Performing a multiple column lookup | Excel Discussion (Misc queries) | |||
Searching for a string and then performing an action if present | Excel Programming |