Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

Find Specific word and then highlight range of cells

I need to be able to find either a word or a word that starts with xx and then highlight a specific range.

I have this code but it only highlights the word. Could someone assist please. I need to be able to Highlight the row from A to R

Dim vCells As Range
   
    Sheets("Result").Select
    For Each vCells In Range("A1:A2000").Cells
        If Left(vCells.Text, 2) = "Ev" Then
            vCells.Interior.ColorIndex = 43
            vCells.Borders.LineStyle = xlContinuous
            vCells.Borders.Weight = xlThin
        End If
    Next vCells

many thanks
SOLUTION
Avatar of [ fanpages ]
[ fanpages ]

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try

Dim vCells As Range
    
    Sheets("Result").Select
    For Each vCells In Range("A1:A2000").Cells
        If Left(vCells.Text, 2) = "Ev" Then
            vCells.Resize(1, 18).Interior.ColorIndex = 43
            vCells.Resize(1, 18).Borders.LineStyle = xlContinuous
            vCells.Resize(1, 18).Borders.Weight = xlThin
        End If
    Next vCells

Open in new window

Regards
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jagwarman

ASKER

Thank you