点击某一单元格,从另一张表中次查找数据,并标色
Public Sub Worksheet_selectionChange(ByVal Taget As Range)
Dim cel As Range
For Each cel In Sheet2.UsedRange
cel.Interior.Color = xlNone
If cel = ActiveCell Then
cel.Interior.Color = RGB(255, 0, 0)
End If
Next
Sheet2.Activate
End Sub
Dim cel As Range
For Each cel In Sheet2.UsedRange
cel.Interior.Color = xlNone
If cel = ActiveCell Then
cel.Interior.Color = RGB(255, 0, 0)
End If
Next
Sheet2.Activate
End Sub
温馨提示:答案为网友推荐,仅供参考