Hi so the issue is that i'm supposed to getting this formula here "
=IFERROR(INDEX(DB_DBS_Deposits!H$2:H$100000, SMALL(IF((DB_DBS_Deposits!F$2:F$100000=E169)*(DB_DBS_Deposits!H$2:H$100000=G169), ROW(DB_DBS_Deposits!H$2:H$100000)-ROW(DB_DBS_Deposits!H$2)+1), 1)), "")
"
but instead after running my macro, i'm greeted with =IFERROR(@INDEX(DB_DBS_Deposits!H$2:H$100000, SMALL(IF((@DB_DBS_Deposits!F$2:F$100000=E169)*(@DB_DBS_Deposits!H$2:H$100000=G169),@ ROW(DB_DBS_Deposits!H$2:H$100000)-ROW(DB_DBS_Deposits!H$2)+1), 1)), "").
which ultimately makes my macro fail.
Piece of code used:
For i = 2 To reconLastRow ' Assuming your data starts from row 1
If Not newSheet.Rows(i).Hidden Then ' Check if the row is visible (not hidden by a filter)
newSheet.Cells(i, 6).Formula = "=IFERROR(INDEX(DB_DBS_Deposits!R2C[2]:R100000C[2], SMALL(IF((DB_DBS_Deposits!R2C:R100000C=RC[-1])*(DB_DBS_Deposits!R2C[2]:R100000C[2]=RC[1]), ROW(DB_DBS_Deposits!R2C[2]:R100000C[2])-ROW(DB_DBS_Deposits!R2C[2])+1), 1)), """")"
End If
Next
=IFERROR(INDEX(DB_DBS_Deposits!H$2:H$100000, SMALL(IF((DB_DBS_Deposits!F$2:F$100000=E169)*(DB_DBS_Deposits!H$2:H$100000=G169), ROW(DB_DBS_Deposits!H$2:H$100000)-ROW(DB_DBS_Deposits!H$2)+1), 1)), "")
"
but instead after running my macro, i'm greeted with =IFERROR(@INDEX(DB_DBS_Deposits!H$2:H$100000, SMALL(IF((@DB_DBS_Deposits!F$2:F$100000=E169)*(@DB_DBS_Deposits!H$2:H$100000=G169),@ ROW(DB_DBS_Deposits!H$2:H$100000)-ROW(DB_DBS_Deposits!H$2)+1), 1)), "").
which ultimately makes my macro fail.
Piece of code used:
For i = 2 To reconLastRow ' Assuming your data starts from row 1
If Not newSheet.Rows(i).Hidden Then ' Check if the row is visible (not hidden by a filter)
newSheet.Cells(i, 6).Formula = "=IFERROR(INDEX(DB_DBS_Deposits!R2C[2]:R100000C[2], SMALL(IF((DB_DBS_Deposits!R2C:R100000C=RC[-1])*(DB_DBS_Deposits!R2C[2]:R100000C[2]=RC[1]), ROW(DB_DBS_Deposits!R2C[2]:R100000C[2])-ROW(DB_DBS_Deposits!R2C[2])+1), 1)), """")"
End If
Next