Hi Andrea,
Hope the below code helps!!!
Sub test()
Dim i As Integer
Dim mSearch As String
On Error GoTo HandleError
'This is your search string
mSearch = "test"
'Search for the string in column A
i = WorksheetFunction.Match(mSearch, Range("A:A"), 0)
'If found select the entire row
Range("" & i & ":" & i & "").Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Range("A" & i).Select
HandleError:
End Sub

Signature
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!
> Hi Everyone
>
[quoted text clipped - 15 lines]
>
> Andrea
Sub ColorCells()
Dim ans As String, ans1 As Long
Dim c As Range, rng2 As Range
Dim firstaddress As String
With ActiveSheet
Set rng2 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
ans = InputBox("Enter string to search for")
ans1 = Application.InputBox("enter colorIndex number for color", Type:=1)
Set c = rng2.Find(What:=ans, _
After:=rng2(rng2.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not c Is Nothing Then
firstaddress = c.Address
Do
c.EntireRow.Interior.ColorIndex = ans1
Set c = rng2.FindNext(c)
Loop While c.Address <> firstaddress
End If
End Sub
Worked for me.

Signature
Regards,
Tom Ogilvy
> Hi Everyone
>
[quoted text clipped - 15 lines]
>
> Andrea
JW - 19 Sep 2007 16:43 GMT
Depending on how many conditions you have, I believe Conditional
Formatting might be the way to go here.
> Sub ColorCells()
> Dim ans As String, ans1 As Long
[quoted text clipped - 48 lines]
> >
> > Andrea
Tom Ogilvy - 19 Sep 2007 18:08 GMT
I the OP doesn't mind the overhead and only needs 3 colors plus the
background color, I would agree. If he will be changing colors or doesn't
want the overhead (or is using conditional formatting for some other purpose)
or needs more than 3, then perhaps not.
Nonetheless go ahead and lay it out.

Signature
Regards,
Tom Ogilvy
> Depending on how many conditions you have, I believe Conditional
> Formatting might be the way to go here.
[quoted text clipped - 50 lines]
> > >
> > > Andrea
amorrison2006@googlemail.com - 24 Sep 2007 20:22 GMT
Hi Tom
I wondered if there is a way for your original macro to lookup the
exact values from sheet2 column A and then the colorindex value from
sheet2 column B. This would save me alot of time.
Please let me know if your macro can be revised to show this.
Thanks alot
Andrea
On Sep 19, 3:22 pm, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> Sub ColorCells()
> Dim ans As String, ans1 As Long
[quoted text clipped - 51 lines]
>
> - Show quoted text -