+ Reply to Thread
Results 1 to 13 of 13

Index function in vba not returning result

Hybrid View

  1. #1
    Registered User
    Join Date
    05-03-2014
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Index function in vba not returning result

    Quote Originally Posted by MrShorty View Post
    Do you know which Match function is failing? If you step through the code (http://www.cpearson.com/Excel/DebuggingVBA.aspx ), which line causes the error?

    Usually this error is because the exact text string (3rd argument to the Match function =0) "Le Matin" is not found in .Columns("A:A") or the exact date value "01/01/2015" is not found in row r. That would be my first guess. This will mean looking through those ranges and at those values and determining if they are there or not. Look for leading/trailing spaces or other non-printing characters in your text strings, and make sure the date search is not missing something because of date/time combinations.

    As a debugging step, you might try pulling values from within the search range. For example,
     papername=workbooks("Journaux_2015.xls").sheets("Feuill").range("A10").value
    paperdate=workbooks("Journaux_2015.xls").sheets("Feuill").range("M3").value
    so that you know your search values are taken from the database, and should be found. That will give you the opportunity to compare what these variables contain when something known to be in the database is there, and what is there when you enter the constant values that you currently have.
    when running:

    papername = Workbooks("Journaux_2015.xls").Sheets("Feuill").Range("d7").Value
    I get "subscript out of range" !??

  2. #2
    Registered User
    Join Date
    05-03-2014
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Index function in vba not returning result

    Ok i sorted out the match problem using activesheet method but the problem is is my range variable: sourcerange

    the worksheet function does not support this property apparently, any idea?

+ 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. Index/Match returning 2nd/3rd/nth result in each proceeding column
    By tbar05 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2015, 01:00 AM
  2. [SOLVED] Index match not returning the desired result - help appreciated
    By sipa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2014, 10:41 AM
  3. IF Function Not Returning Logical Result
    By es247 in forum Excel General
    Replies: 13
    Last Post: 06-16-2012, 08:55 PM
  4. Index/Match Returning N/A Result
    By Killer17 in forum Excel General
    Replies: 1
    Last Post: 01-09-2009, 11:15 PM
  5. Index formula returning incorrect result
    By Nadir Soofi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2008, 02:08 PM

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