Hi All
I'm wondering if anyone can help me with the correct placement of line continuation in VBA. I have a piece of code that essentially just adds up the results of a number of sumifs, however, I cannot seem to find where in the individual sumifs formulas the line continuation needs to be placed to avoid syntax errors.
Any help at all would be appreciated!
I'm wondering if anyone can help me with the correct placement of line continuation in VBA. I have a piece of code that essentially just adds up the results of a number of sumifs, however, I cannot seem to find where in the individual sumifs formulas the line continuation needs to be placed to avoid syntax errors.
Any help at all would be appreciated!
Code:
WC = Sheets("Export").Range("A1").Cells(lrow + 1, 1).Value
Sheets("Export").Range("B1").Cells(lrow + 1, 1).Formula = "SUMIFS('Raw Data'!$T:$T,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 1"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 2"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 3"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 4"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 5"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 6"")+ _
SUMIFS('Raw Data'!$J:$J,'Raw Data'!$D:$D,"">=""&" & WC & ",'Raw Data'!$D:$D,""<""&" & WC & "+7,'Raw Data'!$I:$I,""Ward 7"")"