Results 1 to 5 of 5

Excel 2007 : Highlighting Specific Collumns Macro

Threaded View

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Highlighting Specific Collumns Macro

    I am trying to use a macro that will highlight columns E and I of the rows that collumn L equals "XXXXXXX." How can I designate the columns to tie into the row?

    Sub highlight()
    
    Dim rg As Range, c As Range
      Dim firstAddress As String
        Set rg = Range("L9", "L5000")
        Application.ScreenUpdating = False
    With rg
        Set c = .Find("XXXXXXX", lookat:=xlWhole, LookIn:=xlValues)
        If Not c Is Nothing Then
            firstAddress = c.Address
            Do
                c.Columns.Range("E", "I").Interior.ColorIndex = 4 "ISSUE IS HERE
                
                Set c = .FindNext(c)
                If c Is Nothing Then Exit Do
            Loop While c.Address <> firstAddress
        End If
    Application.ScreenUpdating = True
    End With
    
    End Sub
    Last edited by Paul; 06-04-2012 at 06:09 PM. Reason: Added CODE tags for new user. Please do so yourself in the future.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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