-
How about
[VBA]
Function lngNumberFound(strFieldValue As String) As Long
lngNumberFound = 0
With Worksheets("Sheet1").Range("a3:d20")
Set c = .Find(strFieldValue, LookIn:=xlValues)
If Not c Is Nothing Then
firstaddress = c.Address
Do
lngNumberFound = lngNumberFound + 1
Set c = .Find(c, after:=c)
Loop While c.Address <> firstaddress
End If
End With
End Function
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules