Found a VB sample on MSDN in which it is done like this :
code:
Sub FindStrings() Dim firstCell, nextCell, stringToFind As String ' Show an input box and return the entry to a variable. stringToFind = _ Application.InputBox("String to find?", "Search String") ' Set an object variable to evaluate the Find command. Set firstCell = Cells.Find(what:=stringToFind, lookat:=xlWhole, _ searchdirection:=xlPrevious) ' If the string is not found, show this message box. If firstCell Is Nothing Then MsgBox "Search Value Not Found.", vbExclamation Else ' Otherwise, find the next occurrence of the search text. nextCell = _ Cells.FindNext(after:=Range(firstCell.Address)).Address ' Show its address in a message box. MsgBox nextCell ' Continue finding the next occurrence as long as the address of ' the found cell is not the same as the first cell. Do While firstCell.Address <> nextCell nextCell = Cells.FindNext(after:=Range(nextCell)).Address MsgBox nextCell Loop End If End Sub
Got to leave now, looking forward to see what you came up with
[ 20. May 2003, 16:40: Message edited by: Jochen ]
-4163 means search by value (may be the default anyways) and 2 means xlPart. Dont forget that the search starts after the first cell specified in the range. -Shawn
hehee - yeah, just fire-up Excel and start Tools->Macro->VBEditor. Then go View->ObjectBrowser. In the ComboBox change "All Libraries"to "Excel". Scroll down to XLLookAt and note the right view showing the constants. Click on xlPart and you should see the value in the lower pane. This is using Office97.