+ Reply to Thread
Results 1 to 8 of 8

Application.WorksheetFunction.Match in VBA

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    13

    Application.WorksheetFunction.Match in VBA

    Hi,

    I am trying to match a value to another sheet in the workbook. I am trying to use Application.WorksheetFunction.Match but I am not getting correct results.

    My code for the match:
    Please Login or Register  to view this content.

    I also tried the followiing code but still incorrect results.
    Please Login or Register  to view this content.
    I appreciate any direction you can provide.

    Thanks
    Last edited by karen53; 10-24-2014 at 05:20 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,492

    Re: Application.WorksheetFunction.Match in VBA

    Comment out the On Error Resume Next to see how it fails. I suspect though that you do NOT need the dot in front of "sheets"


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Application.WorksheetFunction.Match in VBA

    Thank you for your reply TMS,

    I removed the dot in front of sheets but it still did not give correct results.

    I commented out the on error resume next and received this message

    Run-time error '1004':
    Unable to get the Match property of the WorksheetFunction class

    What do I have incorrect?

    Thanks,

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Application.WorksheetFunction.Match in VBA

    What results are you getting and how are they incorrect?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    10-09-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Application.WorksheetFunction.Match in VBA

    Sites that don't match are showing up as a match.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,492

    Re: Application.WorksheetFunction.Match in VBA

    Ok, so that seems to confirm it is the MATCH. Can you post a sample workbook?

  7. #7
    Registered User
    Join Date
    10-09-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Application.WorksheetFunction.Match in VBA

    If you look on my upload tab I have a double check for the site id. It is in the site id column (the value searched for) and it is also the first 8 letters of the project ID. They do not match. If I don't have the correct row number it is pulling in an incorect project ID as well as others.

    Thanks for your help.



    Never mind TMS. I figured it out. My range on shtMod needed to start on row 1.

    Thanks!
    Last edited by karen53; 10-24-2014 at 06:20 PM.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,492

    Re: Application.WorksheetFunction.Match in VBA

    Thank goodness for that. I don't think I was ever going to find it!




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Application.worksheetfunction.match problem
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-28-2013, 08:47 AM
  2. Application.Worksheetfunction.match ERROR
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2013, 01:27 PM
  3. Overwriting Information with Application.WorksheetFunction.Match (Excel03)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2012, 08:36 AM
  4. [SOLVED] Application.WorksheetFunction.Match
    By TK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2005, 05:05 PM
  5. [SOLVED] Application.WorksheetFunction.Match problem
    By Carl Brehm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2005, 11:06 AM

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