"run time error 1004 method match property of the worksheetfunction class

  • I'm facing the problem "run time error 1004 method match property of the worksheetfunction class" trying to find a solution. But I don't understand very much about VBA. Please suggest me how to fix it. thank you

  • Explain what you are doing and what these variables are populated with


    Code
    1. Dim sColumn As String 'To store the column selection
    2. Dim sValue As String 'To hold the search text value

    An example workbook might help.

  • Explain what you are doing and what these variables are populated with


    Code
    1. Dim sColumn As String 'To store the column selection
    2. Dim sValue As String 'To hold the search text value

    An example workbook might help.

    this workbook, help me pls.

  • Code
    1. iColumn = Application.WorksheetFunction.Match(sColumn, shDatabase.Range("A1:L1"), 0)

    iColumn is declared as an integer, but the formula will not return an integer.


    I think you are looking for a specific column in the header row. If you are then use the FInd method which will return a cell and from that get the column number.


    Also, put the code into the UserForm not a Module.

  • Code
    1. iColumn = Application.WorksheetFunction.Match(sColumn, shDatabase.Range("A1:L1"), 0)

    iColumn is declared as an integer, but the formula will not return an integer.


    I think you are looking for a specific column in the header row. If you are then use the FInd method which will return a cell and from that get the column number.


    Also, put the code into the UserForm not a Module.


    I'm not very knowledgeable in VBA. would be greatly appreciated If you can help me fix it in a submission that I don't know. thank you very much