Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Unanswered: Macro for Match Index not working.

    Hi,

    HTML Code:
    Database				RESULT		
    ID	Type	Record		ID	Type	Record
    142163	2001	141780		142163	2001	141780
    142118	2010	141780		142163	2010	141780
    141461	3001	141780		142163	3001	141780
    142094	3003	141780		142163	3003	141780
    142094	3008	141780		142163	3008	141780
    						
    141791	1001	141481		141791	1001	141481
    142264	1002	141481		141791	1002	141481
    					
    141928	1002	141895		141928	1002	141895
    142159	3001	141895		141928	3001	141895
    142062	2008	141895		141928	2008	141895
    141493	3003	141895		141928	3003	141895
    141596	1001	141895		141928	1001	141895
    						
    141494	1101	141950		141494	1101	141950
    142281	1102	141950		141494	1102	141950
    Code:
    Sub Macro1()
     With Selection
     
    .ClearContents
     .FormulaArray = _
     "=IFERROR(INDEX($A$1:$A$15,MATCH(C2,IF($B$1:$B$15=2001,$C$1:$C$15),0)),IFERROR(INDEX($A$1:$A$15,MATCH(C2,IF($B$1:$B$15=1001,$C$1:$C$15),0)),INDEX($A$1:$A$15,MATCH(C2,IF($B$1:$B$15=1101,$C$1:$C$15),0)))"
     
    .Copy Selection.Offset(1).Resize(4)
     End With
     End Sub
    The above Macro returns an Run time error '1004': Unable to set FormulaArray property of the Range class.

    Please will some one help and modify to get the results.
    I need this macro to generate the results from Col D2 and to be copied down as far as
    there is contiguous data in column A.
    Last edited by foncesa; 06-28-13 at 13:43.

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Hi, you're missing a close bracket at the end of the formula.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •