none
run-time error "1004"

    Question

  • hello,

    can someone please help me, i am getting Run-time error "1004" and i don´t know how to fix it...

    here is the code:

        With Application.WorksheetFunction
            Weight = .Match(WeightLookupValue, WeightLookupArray, 1)
            OriginDestination = .Match(OriginDestinationLookupValue, OriginDestinationLookupArray, 0)
            Price = .Index(IndexArray, Weight, OriginDestination)
            Baseprice = Price
        End With

    there are values in Weight and OriginDestination and array in IndexArray but Price is empty? Did i write it wrong???

    thanks for your help 

    Mathew

    Friday, September 27, 2013 9:19 AM

All replies

  • how you have declared those variable

    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Friday, September 27, 2013 9:57 AM
  • This is variable declaration:

        Dim Weight As Integer
        Dim OriginDestination As String
        Dim WeightLookupValue As Variant
        Dim WeightLookupArray As Variant
        Dim OriginDestinationLookupValue As Variant
        Dim OriginDestinationLookupArray As Variant
        Dim IndexArray As Variant
        Dim Price As Variant

    Mathew

    Friday, September 27, 2013 9:59 AM
  • MATCH function accepts range reference or range as argument for LOOKUP_ARRAY. Try using range reference or range instead of variant.


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Saturday, September 28, 2013 7:20 AM