+ Reply to Thread
Results 1 to 2 of 2

Unable to get Match property of the WorksheetFunction class

  1. #1
    Registered User
    Join Date
    06-30-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    12

    Unable to get Match property of the WorksheetFunction class

    hi ..

    I have written a macro to find out the particular colomn name.

    In my macro im using

    Please Login or Register  to view this content.
    to compare whether 'design step' is there in the first row.

    When i executed this code, in some sheets its working fine but in some sheets its throwing error like 'Unable to get Match property of the WorksheetFunction class '. I tried changing the code to

    Please Login or Register  to view this content.
    by removing 'WorksheetFunction'. When i execute the code, the previous error was gone but 'Type Mismatch' error is coming.

    And also want to add code for error hanndling like if the string is not found go to the next tab in the same workbook.
    Can anyone help me in this . Thanks in advance.
    Last edited by JBeaucaire; 10-29-2012 at 09:51 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Unable to get Match property of the WorksheetFunction class

    The MATCH function alwats protests when it does not find the match, even when when used as a function in a cell. But in VBA you also have to code around that result and deal with it.

    The simplest is to put On Error Resume Next above it so the code will proceed and default to a value of zero when no match is found.
    Please Login or Register  to view this content.

    So, if you're trying to determine which sheet in the workbook has the "Design Step" column and then mark that worksheet to be used, something like:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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