Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Highlight ROW excel VBA

Posted on 2013-05-18
3
Medium Priority
?
768 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 35

Accepted Solution

by:
Norie earned 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

609 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