Hi All
I have created index match formulas below and I need to make the worksheets name generic, Sheets(2) and Sheets(3). The macro below doesn't work, could anyone help me please? I am not sure is it the right way to make worksheet name generic. Thanks.
I have created index match formulas below and I need to make the worksheets name generic, Sheets(2) and Sheets(3). The macro below doesn't work, could anyone help me please? I am not sure is it the right way to make worksheet name generic. Thanks.
VBA Code:
[SIZE=4][FONT=Segoe UI][COLOR=rgb(20, 20, 20)]Sheets(3).Select
Dim LastRow As Long
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
Range("O25").FormulaArray = "=iferror(index(Sheets(2)!$C$15:$AZ$15,match(Sheets(3)!$B25,Sheets(2)!$C$10:$AZ$10,0)),"""")" & _
""
Range("P25").FormulaArray = "=iferror(index(Sheets(2)!$C$35:$AZ$35,match(Sheets(3)!$B25,Sheets(2)!$C$10:$AZ$10,0)),"""")" & _
""
Range("Q25").FormulaArray = "=iferror(index(Sheets(2)!$C$37:$AZ$37,match(Sheets(3)!$B25,Sheets(2)!$C$10:$AZ$10,0)),"""")" & _
""
Range("R25").FormulaArray = "=iferror(index(Sheets(2)!$C$39:$AZ$39,match(Sheets(3)!$B25,Sheets(2)!$C$10:$AZ$10,0)),"""")" & _
""
Range("O25:J" & LastRow).FillDown
Range("P25:P" & LastRow).FillDown
Range("Q25:Q" & LastRow).FillDown
Range("R25:R" & LastRow).FillDown
End Sub[/COLOR][/FONT][/SIZE]