VBA learner ITG
Active Member
- Joined
- Apr 18, 2017
- Messages
- 267
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi all,
I am trying to fill down Column C with the formula values until the end of column A and I am getting an error on the formula which I know is correct as if its written as a formula works as expected.
Any advice on what i am doing wrong?
I am trying to fill down Column C with the formula values until the end of column A and I am getting an error on the formula which I know is correct as if its written as a formula works as expected.
Any advice on what i am doing wrong?
Code:
Sub FORMULA()
Dim LastRow As Long
With ThisWorkbook.sheets("FUSION_INTERMEDIATE")
'Assume we want to create values for every cell in column C down until
'we get to the last cell in column A
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
'Paste the formula
.Range("C4:C" & LastRow).Formula = "=IFERROR(INDEX(UNIQUE(FILTER(Brief!$B$7:$B$5000,Brief!$AA$7:$AA$5000=A4)),COUNTIFS(A$4:A4,A4)),"")"
'Convert to values
.Range("C4:C" & LastRow).Value = _
.Range("C4:C" & LastRow).Value
End With
End Sub