Solved

Highlight ROW excel VBA

Posted on 2013-05-18
3
760 Views
Last Modified: 2013-05-18
Hello,
can you please help,
I'm trying to highlight the Row based on if cell Contains specific text  "RETURN"  

Example , cell has this text
** RETURN **RETURN_ETOBICOKE ON

it is not Highlighting the Row.


Sub HighLight_Retrun_cells()
Sheets("Detail").Select
i = 2
For Each c In ActiveSheet.Range("E2:E" & Range("E" & Rows.Count).End(xlUp).Row)
    If Cells(i, 5) = "RETURN" Then
        Rng = "A" & i & ":" & "O" & i
        Range(Rng).Interior.ColorIndex = 6
    End If
    i = i + 1
    Next c
End Sub

Any help is appreciated.
thanks
0
Comment
Question by:W.E.B
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 250 total points
ID: 39177766
Try this.
Sub HighLight_Retrun_cells()
Dim c As Range

    For Each c In Sheets("Detail").Range("E2:E" & Range("E" & Rows.Count).End(xlUp).Row)
        If c.Value Like "*RETURN*" Then
            c.Offset(, -4).Resize(, 15).Interior.ColorIndex = 6
        End If
    Next c

End Sub

Open in new window

0
 

Author Comment

by:W.E.B
ID: 39177771
This does it,
thank you.
0
 

Author Closing Comment

by:W.E.B
ID: 39177772
Thanks
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question