Hello,
Can someone assist me with some syntax issues I am having? Any help would be greatly appreciated!
The below codes are not working as there is syntax issues with both codes. I have been struggling to correct it but can not find anything to correctly incorporate both the variable ranges with the variable criteria within the "Sumifs" equation.
Sub Test()
LastRow_A = Sheets("A").Range("E1048576").End(xlUp).Row
LastRow_B = Sheets("B").Range("E1048576").End(xlUp).Row
Range("T2:T" & LastRow_B).FormulaR1C1 = _
"=SumIfs(A2:A " & LastRow_A & ", K2:K " & LastRow_A & ", B!RC[-14], G2:G " & LastRow_A & ", B!RC[-17], H2:H " & LastRow_A & ", B!RC[-16])"
End Sub
or
Sub Test()
With ActiveSheet
LastRow_A = Sheets("A").Range("E1048576").End(xlUp).Row
LastRow_B = Sheets("B").Range("E1048576").End(xlUp).Row
Set RngA = Sheets("A").Range("A2:A" & LastRow_A)
Set RngB = Sheets("A").Range("K2:K" & LastRow_A)
Set RngC = Sheets("A").Range("G2:G" & LastRow_A)
Set RngD = Sheets("A").Range("H2:H" & LastRow_A)
End With
Range("T2:T" & LastRow_A).FormulaR1C1 = _
"=SUMIFS(RngA, RngB, A!RC[-14], RngC, A!RC[-17], RngD, A!RC[-16])"
End Sub
Neither of these are working correctly, but i think this should help with understanding my issue.
Thanks!
Bookmarks