Try this one:
Sub isExist() On Error Resume Next If WorksheetFunction.Match(Range("rngValues").Value, Range("List"), 0) Then If Err.Number = 1004 Then Err.clear On error goto 0:on Error Goto -1 MsgBox "Values not found" Else MsgBox Range("rngValues").Value End If End If End Sub From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Ashish Bhalara Sent: Jan/Thu/2012 12:30 To: excel-macros@googlegroups.com Subject: Fwd: $$Excel-Macros$$ Need help in Excel-VBA code to write function in coding Dear experts, I have lower level knowledge in excel vba, so please check below coding which not working. I need the Msgbox when entered value match from another sheet. The example sheet attached herewith. Please also know the basic rules of how to use excel function in Visual Basic. If match(Worksheets("Account Statement").Range("E6").Value, Worksheets("Account Status").Range("K:K"), 0) > 0 Then MsgBox "Bill is made of this Chassis" End If Kindly solve my query that I use macro in .xlsx format, so what is the difference to use macro in macro-enable workbook format and simple .xlsx format? Thanks & Regards Ashish Bhalara 9624111822 -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ---------------------------------------------------------------------------- -------------------------- To post to this group, send email to excel-macros@googlegroups.com -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com