Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Method in excel

Status
Not open for further replies.

mo2783

Programmer
Nov 16, 2003
68
GB
Hiya All

I have a worksheet with functions created by the user called =PutValues(), what i am trying to do is write some code to find these function and count how many are on the worksheek. I have something like 30 worksheets full of them. i have wrote the following code:

Code:
Public Function PutValueOccurrence(strPutValueStartingPoint As String, intRowCount) As Integer

    Dim intI, intFound As Integer
    Dim strFindItem As String
    Dim lCount As Long
    
    strFindItem = "PutValues"
    
    Range("A1").Select
        
    For lCount = 1 To intRowCount
        Range("A" & lCount).Select
        If Rows.Find(What:=strFindItem, After:=ActiveCell, _
                        LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
                            SearchDirection:=xlNext, MatchCase:=False) = "PutValues" Then
            
            MsgBox "Found"
            intFound = 1 + intFound
                       
        Else
           
           MsgBox ActiveCell.Address
        End If
    Next
   
    PutValueOccurrence = intFound

End Function

Any help wil be much appreciated
 
I think you would be better off posting in:

VBA Visual Basic for Applications (Microsoft) Forum
forum707

There are more people there who are interested in Excel. This is an Access forum.
 
ok will do, how do i delete this from this forum?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top