Help With Macro

  steviegee 08:46 13 Jul 2010
Locked

I was given the macro below to highlight any cell with data in it that is on sheet 2 but not on sheet 1. Could it also work the same to highlight what is on sheet 4 but not on sheets 1, 2 and 3? If so what would the new macro be please? Thanks.

Sub steviegee()
Dim c As Range, Found As Range
With Sheets("Sheet2")
For Each c In .UsedRange
Set Found = Sheets("Sheet1").UsedRange.Find(what:=c.Value)
If Found Is Nothing Then c.Interior.ColorIndex = 3
Next c
End With
End Sub

  VoG II 09:14 13 Jul 2010

A bit kludgy but try

Sub steviegee()
Dim c As Range, Found As Range
With Sheets("Sheet4")
For Each c In .UsedRange
Set Found = Sheets("Sheet1").UsedRange.Find(what:=c.Value, LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then Set Found = Sheets("Sheet2").UsedRange.Find(what:=c.Value, LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then Set Found = Sheets("Sheet3").UsedRange.Find(what:=c.Value, LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then c.Interior.ColorIndex = 3
Next c
End With
End Sub

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Fujitsu Lifebook P727 laptop review

Converse draws on iconic heritage for a fresh brand identity

Mac power user tips and hidden tricks

Comment lancer Windows 10 en mode sans ├ęchec ?