Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This Function Is supposed to Search each sheet in the workbook, and
return 1 if it found a match and 0 if it doesnt, Can anyone help im really stumped :| Function Search(StrToSearch As String) Dim sh As Worksheet Dim SearchTxt As String Dim rng As Range Dim firstAddress As String Dim IntNumber As Integer IntNumber = 0 SearchTxt = StrToSearch For Each sh In ThisWorkbook.Worksheets sh.Activate Set rng = sh.Cells.Find(What:=SearchTxt, After:=sh.Cells.Range("A1"), _ LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=True) If Not rng Is Nothing Then Search = IntNumber + 1 Exit For End If Next sh End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF(AND(OR function returns #VALUE! error | Excel Worksheet Functions | |||
LINEST() function returns error. | Excel Discussion (Misc queries) | |||
Find function returns the #VALUE! error value | Excel Discussion (Misc queries) | |||
sumproduct function returns #value or #ref error | Excel Worksheet Functions | |||
Function returns Range -- error 91 | Excel Programming |