Consulting

Results 1 to 6 of 6

Thread: Search a string to contains....

  1. #1
    VBAX Regular
    Joined
    Mar 2013
    Posts
    80
    Location

    Search a string to contains....

    Hello

    I am struggling with stupid problems, sorry to bother you with beginner questions

    I've got checks on column headers (to insure essential information exists):

    Set Found = Rows(1).Find(What:="FTE", After:=Cells(1, 5))
    What syntax will give me a Found =OK, based on header "contains" FTE, and no "match exactly" like it does now?

  2. #2
    Hi Valerie

    Please look at the help of the Find() method of the Range object to know what options are available to you.

    In this case, maybe you want:

    Set Found = Rows(1).Find( _
        What:="FTE", _
        After:=Cells(1, 5), _
        LookIn:=xlValues, _
        LookAt:=xlPart, _
        MatchCase:=False)

  3. #3
    VBAX Regular
    Joined
    Mar 2013
    Posts
    80
    Location
    Thanks a lot.

    I always check the help before, but in that case, see below the help I've got. Should have I understood that it doesn't stops at Arg3, and that there always can be more optional arguments?

    Excel Developer Reference
    WorksheetFunction.Find Method
    Finds specific information in a worksheet. Syntax
    expression.Find(Arg1, Arg2, Arg3)
    expression A variable that represents a WorksheetFunction object.
    Parameters
    Name Required/Optional Data Type Description
    Arg1 Required String The name of the worksheet.
    Arg2 Required String The name of the range.
    Arg3 Optional Variant The name of an argument to refine the search.

    Return Value
    Double
    © 2010 Microsoft Corporation. All rights reserved.





  4. #4
    Hi Valerie

    I'm glad it helped.

    The help you posted is the help on the Find() method of the WorksheetFunction object.

    You should check the help on the Find() method of the Range object. There you can find the options you need for this case.

  5. #5
    VBAX Regular
    Joined
    Mar 2013
    Posts
    80
    Location
    I just press F1 and it comes automatically... Life is not fare to empiric self learning beginner :-)

    Thanks you again and have a nice day

  6. #6
    You're welcome. Thanks for the feedback.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •