+ Reply to Thread
Results 1 to 4 of 4

Error using Match method of WorksheetFunction

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    Hermosillo, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    2

    Error using Match method of WorksheetFunction

    Hello,

    I'm trying to use the Match property to find a value in a list and I am getting a run-time error that I have not been able to solve.

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

    The syntax I am using is the following:
    GralesGuia(1) = Range("C8").Value
    'Identificar Row de la guía solicitada en pestaña Datos
    Set RangoGuias = Worksheets("Datos Guias Carretera").Range("A3:A500")
    RowGuia = WorksheetFunction.Match(GralesGuia(1), RangoGuias, 0)

    I also tried "Application.Worksheets("Datos...
    but I get the same error.

    I would be verry thankful if someone could give me a hand.
    I know I can do this with a loop but I would like to learn how to use the WorksheetFunction methods.

    Thanks!

    szepeda.

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

    Re: Error using Match method of WorksheetFunction

    How are GralesGuia and RowGuia declared?

    Also, what type of data is there in A3:A500 on 'Datos Guias Carretera'?7

    PS Please use code tags when posting code.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-18-2013
    Location
    Hermosillo, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Error using Match method of WorksheetFunction

    Hello,

    I did not declare the types of both GralesGuia and RowGuia so they are Variant.
    GralesGuia is a vector of 13 elements.

    Here is the syntax I used to declare them:
    Dim RowGuia
    Dim GralesGuia(13)

    Each cell of A3:A500 of 'Datos Guias Carretera' contains either an integer value that tags the "Trip Number" that is contained in the given row or is empty.

    Thank you very much for your help.

    I am new in this and do not know what is a "code tag"; if you could please clarify what it is so that I can include them in my future posts.

    szepeda

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

    Re: Error using Match method of WorksheetFunction

    What happens if you try this?
    Please Login or Register  to view this content.
    PS Check the link below my post for how to use code tags.

+ 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. [SOLVED] WorksheetFunction.match run time error '1004' with numbers but not text
    By Hussar13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2013, 05:31 PM
  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. WorksheetFunction Match Error: Object Required
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2012, 09:30 AM
  4. Run-time error 1004: Unable to get the Match property of the WorksheetFunction class
    By maffmommie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2010, 09:32 AM
  5. worksheetfunction.match giving run time error '1004'
    By devo2511 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2010, 04:47 PM

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