Namaskar Experts
This code was running fine till I had to replace one of the array formulas. I have run into an error. I need your expertise to replace the array formula for column H and get the correct result as shown in the expected result sheet (Doc1). As earlier I was suggested to share the data with expected results I am sharing both. If any of the members find it difficult to understand or want to write the code from the start in their own style you are most welcome. I have written all the steps I have used to create this application.
TYIA
Sorry! I forgot to change the sheet name in the code. I need help to correct just this one line of code which pastes data in column H. I am getting an error 1004.
'Replace below with =SUM(--(FREQUENCY(MATCH(IF('EditB2B Expected'!B$2:B$100=B2,'EditB2B Expected'!D$2:D$100),IF('EditB2B Expected'!B$2:B$100=B2,'EditB2B Expected'!D$2:D$100),),MATCH(IF('EditB2B Expected'!B$2:B$100=B2,'EditB2B Expected'!D$2:D$100),IF('EditB2B Expected'!B$2:B$100=B2,'EditB2B Expected'!D$2:D$100),))>0))-1
If lr = 2 Then
.Range("H2").FormulaArray = "=SUM(--(FREQUENCY(--(IF('EditB2B'!B$2:B$" & _
Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & "=B2,'EditB2B'!D$2:D$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & _
",),5),--(IF('EditB2B'!B$2:B$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & _
"=B2,'EditB2B'!D$2:D$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & ",),5))>0))"
Else
.Range("H2").FormulaArray = "=SUM(--(FREQUENCY(--(IF('EditB2B'!B$2:B$" & _
Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & "=B2,'EditB2B'!D$2:D$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & _
",),5),--(IF('EditB2B'!B$2:B$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & _
"=B2,'EditB2B'!D$2:D$" & Sheets("EditB2B").Range("A" & Sheets("EditB2B").Rows.Count).End(xlUp).Row & ",),5))>0))-1"
'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Bookmarks