+ Reply to Thread
Results 1 to 3 of 3

If Error condition with Match Function

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171

    If Error condition with Match Function

    Hi, Can do the match function, but need a condition so that if there is an
    error returns 0, with below not returning anything (I have 'On error Resume Next' at top of code)

    Cells(2, 10) = WorksheetFunction.Match(Cells(2, 9), Range(Cells(2, 8), Cells(10, 8)), 0)

  2. #2
    Bob Phillips
    Guest

    Re: If Error condition with Match Function

    On Error Resume Next
    iRow = Application.Match(Cells(2, 9).Value, Range(Cells(2, 8),Cells(10, 8)),
    0)
    On Error Goto 0
    If iRow > 0 Then Cells(2, 10).Value = iRow

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "T De Villiers" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi, Can do the match function, but need a condition so that if there is
    > an
    > error returns 0, with below not returning anything (I have 'On error
    > Resume Next' at top of code)
    >
    > Cells(2, 10) = WorksheetFunction.Match(Cells(2, 9), Range(Cells(2, 8),
    > Cells(10, 8)), 0)
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile:

    http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=566593
    >




  3. #3
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171
    Thanks Bob

+ 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