+ Reply to Thread
Results 1 to 3 of 3

Multiple Find/Search Criterias

Hybrid View

  1. #1
    swiftcode
    Guest

    Multiple Find/Search Criterias

    Hi all,

    I was wondering if there is anyway i simplify the following code to do
    multiple search criterias.

    On Error Resume Next

    Cells.Find(What:="valdate", After:=ActiveCell, _
    LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

    Cells.Find(What:="invaldate", After:=ActiveCell, _
    LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

    On Error Goto 0

    Thanks in advance
    Ray

  2. #2
    Tushar Mehta
    Guest

    Re: Multiple Find/Search Criterias

    '*valdate' (w/o the quotes) will work in this specific instance.
    However, AFAIK, there is no generic 'or' or 'and' capability within the
    Find method.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <3F50EF0F-D53E-4D3C-9CC2-B9CB084D42A6@microsoft.com>,
    swiftcode@discussions.microsoft.com says...
    > Hi all,
    >
    > I was wondering if there is anyway i simplify the following code to do
    > multiple search criterias.
    >
    > On Error Resume Next
    >
    > Cells.Find(What:="valdate", After:=ActiveCell, _
    > LookIn:=xlFormulas, LookAt:=xlPart, _
    > SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    > MatchCase:=False, SearchFormat:=False).Activate
    >
    > Cells.Find(What:="invaldate", After:=ActiveCell, _
    > LookIn:=xlFormulas, LookAt:=xlPart, _
    > SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    > MatchCase:=False, SearchFormat:=False).Activate
    >
    > On Error Goto 0
    >
    > Thanks in advance
    > Ray
    >


  3. #3
    swiftcode
    Guest

    Re: Multiple Find/Search Criterias

    Hi Tushar

    Thank you for your tip, i guess i will

    have to find a better way,

    coz i am searching for multiple different

    words and cannot just use a wildcard.

    Have a good day.

    Rgds
    Ray

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1