+ Reply to Thread
Results 1 to 2 of 2

find and highlight

  1. #1
    Registered User
    Join Date
    02-20-2006
    Posts
    29

    Question find and highlight

    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

  2. #2
    ChristianH
    Guest

    Re: 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



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1