Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm sorry but I didn't state that right.
For the following line: whatwant = Sheets("300-+").Range("$A$65000").Value It will only search for that cell value that is from Sheets "300-+" color that value on sheet "MultAdjDaily". But instead of one value, I would like it to search for multiple cells with values and color them on "MultAdjDaily". I tried the following but it did not work: whatwant = Sheets("300-+").Range("$A$65000:$A$65125").Value I want the code to take the multiple cells with values that are on sheet "300-+" and find them and color them on sheet "MultAdjDaily". Can you show me what to change in order for that to work? -- Cue "Mike H" wrote: Try this Note the corrected use of the LIKE operator Sub find_and_color() Dim MyRange As Range Dim whatwant As String Set MyRange = Range("A65000:A65125") whatwant = Sheets("300-+").Range("$A$65000").Value For Each c In MyRange If c.Value Like "*" & whatwant & "*" Then c.Interior.ColorIndex = 33 End If Next c End Sub Mike "Cue" wrote: Hello, The following code finds the value of the cell then colors the cell. I would like the code to find all of the cells in a range ($A$65000:$A$65125) and color each of them. Can someone tell me or show what to add or change to accomplish this? Sub find_and_color() Dim rCell As Range Dim whatwant As String whatwant = Sheets("300-+").Range("$A$65000").Value For Each rCell In Sheets("MultAdjDaily").Range("$C$6:$C$3001") If rCell.Value Like whatwant Then rCell.Interior.ColorIndex = 33 End If Next rCell End Sub Thanks! -- Cue |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find all same values from defined range | Excel Worksheet Functions | |||
Find a range of values in a range of cells | Excel Worksheet Functions | |||
To find duplicated values in a range | Excel Worksheet Functions | |||
Find dates in a range; then sum values in that range by a criteria | Excel Discussion (Misc queries) | |||
How do I find the two lowest values in a range? | Excel Worksheet Functions |