FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,364
- Office Version
- 365
- 2016
- Platform
- Windows
I currently have the below and it runs fines; however, trying to see if I can speed this up. My guess was either Evaluate or the Worksheet Function might help, but I don't understand how to get the second code to work. Whatever number is produced in D2 is what the entire range shows.
I'm working off of this thread SUMIFS in VBA
I'm working off of this thread SUMIFS in VBA
VBA Code:
Sub Test1()
With Range("D2:G" & Cells(Rows.Count, "A").End(xlUp).Row)
.Formula = "=SUMIFS('Data'!$BI:$BI,'Data'!$F:$F,$C2,'Data'!$U:$U,D$1)"
.Value = .Value
End With
End Sub
VBA Code:
Sub Test4()
Range("D2:G132") = WorksheetFunction.SumIfs(Sheet3.Range("BI:BI"), Sheet3.Range("F:F"), Sheet2.Range("C2"), Sheet3.Range("U:U"), Sheet2.Range("D1"))
End Sub