Cue313
10-13-2008, 08:26 AM
Hello!For the following line:
whatwant = Sheets("300-+").Range("$A$65000").Value
It will only search for that cell value that is from sheet "300-+" and 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 anyone show me what to change in order for that to work? Here is my code:
Sub find_and_color()
Dim rCell As Range
Dim whatwant As String
whatwant = Sheets("300-+").Range("$A$65000").Value
Range("A1").Select
For Each rCell In Sheets("MultAdjDaily").Range("$C$6:$C$3001")
If rCell.Value Like whatwant Then
rCell.EntireRow.Resize(1, 14).Interior.ColorIndex = 33
End If
Next rCell
End Sub
Thanks for your help.
Cue313
whatwant = Sheets("300-+").Range("$A$65000").Value
It will only search for that cell value that is from sheet "300-+" and 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 anyone show me what to change in order for that to work? Here is my code:
Sub find_and_color()
Dim rCell As Range
Dim whatwant As String
whatwant = Sheets("300-+").Range("$A$65000").Value
Range("A1").Select
For Each rCell In Sheets("MultAdjDaily").Range("$C$6:$C$3001")
If rCell.Value Like whatwant Then
rCell.EntireRow.Resize(1, 14).Interior.ColorIndex = 33
End If
Next rCell
End Sub
Thanks for your help.
Cue313