当前位置: 代码迷 >> Office >> Excel有关问题,麻烦出个主意
  详细解决方案

Excel有关问题,麻烦出个主意

热度:9646   发布时间:2013-02-26 00:00:00.0
Excel问题,麻烦各位高手出个主意
Excel问题,麻烦各位高手出个主意。
列A:
13977
13899
13964
13866
13575
13985
13985
13655

列B:
13934
13897
13964
13866
13579
13982
13964
13634

要求:把两列里完全相同的数据用其他颜色标志出来,可以是单元格背景色,也可以是文字颜色。谢谢。

------解决方案--------------------------------------------------------
条件格式,=countif(A:A,A1)

B列同理
------解决方案--------------------------------------------------------
COUNTIF结果>=1不就代表两边都有么,为什么会不成功?
------解决方案--------------------------------------------------------
VB code
    Application.ScreenUpdating = False    l = [B65530].End(xlUp).Row: Columns("C:C").ClearContents    Range("C1:C" & l).FormulaR1C1 = "=MATCH(RC[-1],C[-2],0)"    For i = 1 To l        If Not IsError(Range("C" & i)) Then            With Range("A" & Range("C" & i)).Interior                If .ColorIndex = xlNone Then .ColorIndex = Int(Rnd * 55 + 3)                Range("B" & i).Interior.ColorIndex = .ColorIndex            End With        End If    Next i    Columns("C:C").ClearContents    Application.ScreenUpdating = True
------解决方案--------------------------------------------------------
你可以查一下MATCH命令的用法.
------解决方案--------------------------------------------------------
在C列输入这样的公式,可拖延此公式:=COUNTIF(A:A,B1)
------解决方案--------------------------------------------------------
选中A列
单击格式----条件格式-----选择“公式” 输入 =MATCH(A1,B:B,0)
设定字体或背景,就可以了
  相关解决方案