Hi all,
I have a workbook that i'm using to present analysis of a lot of data. Currently i'm using a sumifs formula with indirect references within the workbook and it's returning the expected value. However, the workbook is very slow and i'm looking to speed it up and make it more responsive. I'm therefore looking at removing the formula from the workbook and have the formula run through vba instead. I can't however get the coding right.
Any thoughts would be welcome!
I have a workbook that i'm using to present analysis of a lot of data. Currently i'm using a sumifs formula with indirect references within the workbook and it's returning the expected value. However, the workbook is very slow and i'm looking to speed it up and make it more responsive. I'm therefore looking at removing the formula from the workbook and have the formula run through vba instead. I can't however get the coding right.
Any thoughts would be welcome!
Code:
Sub Add_Data_HH()
Column_Ref = ActiveSheet.Range("D7").Value
Report_Month = ActiveSheet.Range("D8").Value
Report_Year = ActiveSheet.Range("D9").Value
Data_Source = ActiveSheet.Range("D10").Value
'Oldest
With ActiveSheet
y = 36
For x = 1 To 12
Query_Month = .Range("k" & y).Value
Query_Year = .Range("i34").Value
.Range("i" & y).Value = SumIfs(INDIRECT("'" & Data_Source & "'!" & Column_Ref), INDIRECT("'" & Data_Source & "'!$B:$B"), Query_Year, INDIRECT("'" & Data_Source & "'!$C:$C"), Query_Month)
y = y + 1
Next x
End With
End Sub