please turn off your caps lock..dunno..its pretty
annoying !!!
Please do not moan in my threads - I'm in desperate need of some excel help....
Richard,
Try this macro, I think it does what you are looking to accomplish. It is a case sensitive, whole search, so please modify the code accordingly if you want to search for a part of a word and/or non-case sensitive values.
My thanks to Joe Was and others on this board who helped compile the syntax for this code.
HTH
Tom Urtis
Sub SearchProducts()
Dim searchValue
Dim counter As Integer, sheetCount As Integer
Dim startSheet, startCell
Application.ScreenUpdating = False
On Error Resume Next
startCell = ActiveCell.Address
startSheet = ActiveSheet.Name
searchValue = Application.InputBox("Type in what you want to search for:", Title:="''Search for'' data entry box", Type:=2)
If searchValue = "" Then Exit Sub
If IsError(CDbl(searchValue)) = False Then searchValue = CDbl(searchValue)
sheetCount = ActiveWorkbook.Sheets.Count
counter = 1
Do Until counter > sheetCount
Sheets(counter).Activate
Cells.Find(What:=searchValue, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False).Activate
If ActiveCell.Value = searchValue Then Exit Do
counter = counter + 1
Loop
If ActiveCell.Value <> searchValue Then
MsgBox "The value " & Chr(34) & searchValue & Chr(34) & " was not found.", vbExclamation + vbOKOnly, "Data not found!"
Application.Goto Reference:=Worksheets(startSheet).Range(startCell)
Application.ScreenUpdating = True
Exit Sub
End If
Application.ScreenUpdating = True
End Sub