2015-12-11 43 views

回答

0

使用行的差異比較。

Sub SelectDiffRws() 
    Dim Rws As Long, Rng As Range, rng2 As Range, c As Range 

    Rws = Cells(Rows.Count, "A").End(xlUp).Row 
    Set Rng = Range(Cells(2, 1), Cells(Rws, 2)) 
    Set rng2 = Rng.RowDifferences(Range("A2")) 

    Columns("A:B").Interior.Color = xlNone 

    For Each c In rng2.Cells 
     Range(Cells(c.Row, 1), Cells(c.Row, 2)).Interior.ColorIndex = 3 
    Next c 

End Sub 

看到這裏例如 http://www.xlorate.com/vba-examples.html#Column%20Differences

在這裏看到夾子 https://youtu.be/Fcq4rgigu3w

分享連結sample workbook

+0

謝謝,這一直很有用! – Tecayehuatl