Find Contents

  • Thread starter Thread starter gmc
  • Start date Start date
G

gmc

I need help with some macro programming to find the contents of a specific
cell in the rest of the workbook. Any help?
 
Sub FindData()

Set Data = Sheets("Sheet1").Range("A1")
DataAddr = Data.Address(external:=True)

For Each sht In Sheets
Set c = sht.Cells.Find(what:=Data.Value, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
FirstAddr = c.Address
Do
If c.Address(external:=True) <> DataAddr Then
MsgBox ("Data Found at : " & c.Address(external:=True))
End If
Set c = sht.Cells.FindNext(after:=c)
Loop While Not c Is Nothing And _
c.Address <> FirstAddr

End If
Next sht


End Sub
 
Back
Top