Thread: Find Contents
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Find Contents

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


"gmc" wrote:

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