ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Error condition with Match Function (https://www.excelbanter.com/excel-programming/368827-if-error-condition-match-function.html)

T De Villiers[_77_]

If Error condition with Match Function
 

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

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

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56659


Bob Phillips

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"
wrote in message
news:T.De.Villiers.2bt7xj_1154349202.1579@excelfor um-nospam.com...

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




T De Villiers[_80_]

If Error condition with Match Function
 

Thanks Bob


--
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



All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com