compare column color row


S

SangelNet

Hi guys,

Hope i can get some input on this. the scenarios is this:

sheet 1 column b
sheet 2 column a

for each row in sheet 2 col B compare with each row sheet1 col A. IF
row equal, then change color for the equal row in sheet 2 col A.

Thnx
 
Ad

Advertisements

D

Don Guillett Excel MVP

Hi guys,

Hope i can get some input on this. the scenarios is this:

sheet 1  column b
sheet 2 column a

for each row in sheet 2 col B compare with each row sheet1 col A. IF
row equal, then change color for the equal row in sheet 2 col A.

Thnx

"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
Ad

Advertisements

M

ManicMiner17

Hi guys,

Hope i can get some input on this. the scenarios is this:

sheet 1 column b
sheet 2 column a

for each row in sheet 2 col B compare with each row sheet1 col A. IF
row equal, then change color for the equal row in sheet 2 col A.

Thnx

Hi SangelNet,


Sub CmPare()
Dim i As Long
Dim lastRow As Long
lastRow = Sheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Row

For i = 1 To lastRow
If Sheets("Sheet1").Range("B" & i) = Sheets("Sheet2").Range("A" & i) Then
Sheets("Sheet2").Range("A" & i).Interior.ColorIndex = 3
End If
Next i

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top