View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ChristianH[_2_] ChristianH[_2_] is offline
external usenet poster
 
Posts: 7
Default find and highlight

Hi mariasa

Run this macro. it will find "GR" in the string of col."J" and make the

interior of the entire row red. You can change the color to any color
you like
..Interior.ColorIndex = XX

Sub Test_for_GR()
Dim ws As Worksheet
Dim i As Integer

For Each ws In Worksheets
i = 1
ws.Select
Do
If InStr(1, Cells(i, 10).Value, "GR", vbTextCompare) < 0 Then
With Cells(i, 10).EntireRow
.Interior.ColorIndex = 3
End With
End If
i = i + 1
Loop Until Cells(i, 10).Value = ""

Next ws
End Sub

That should do it


mariasa wrote:

Hi Guys,

could u please help me with the following macro:

i need it to go thru the column J of each of my worksheets (worksheet
names are 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999) and if it
finds "GR" as part of the name in the cell (say IFX GR - thats a
security id in bloomberg), it has to highlight the entire row ( i have
numerous columns in the sheet) and if it doesnt find "GR" it should do
nothing of course. I need this because i need to isolate (or highlight)
the german secondary offerings from the list of european ones.

Thanks so much in advance for your help!
mariasa


--
mariasa
------------------------------------------------------------------------
mariasa's Profile: http://www.excelforum.com/member.php...o&userid=31726
View this thread: http://www.excelforum.com/showthread...hreadid=557532