Hi All,
I want to write some code that will allow me to do a sumifs.
How do I get the code to drop to the next line so 'Graph data'!A4' to changes to 'Graph data'!A5' within the code?
Column A has the time of day, from 8am to 8pm and is the look up
Current code looks like
Sub GraphData()
Sheets("GraphData").Select
Range("B4:M724").clear
Range("B4").select
For I = 1 to 721
Cells(3 + I, 2).Formula = "=SUMIFS(AAA!$F:$F,AAA!$A:$A,""=""&Graphs!$G$1,AAA!$B:$B,""=""&'Graph data'!A4)"
Cells(3 + I, 3).Formula = "=SUMIFS(AAA!$G:$G,AAA!$A:$A,""=""&Graphs!$G$1,AAA!$B:$B,""=""&'Graph data'!A4)"
Cells(3 + I, 3).Formula = "=SUMIFS(AAA!$H:$H,AAA!$A:$A,""=""&Graphs!$G$1,AAA!$B:$B,""=""&'Graph data'!A4)"
Next I
End Sub
Data.JPG
Any help appreciated
Cheers
Dean
Bookmarks