cortexnotion
Board Regular
- Joined
- Jan 22, 2020
- Messages
- 150
- Office Version
- 2013
- Platform
- Windows
Hi there
My code is working well but I want to paste each Area output to the next row between B6:J6 down to B14:J14. However at the moment it is writing everything to row 6 and overwriting itself.
I can't figure out how to get the code to post to the next free row from B5:J5 downwards so it fills all 9 rows. Any help would be great!
My code is working well but I want to paste each Area output to the next row between B6:J6 down to B14:J14. However at the moment it is writing everything to row 6 and overwriting itself.
I can't figure out how to get the code to post to the next free row from B5:J5 downwards so it fills all 9 rows. Any help would be great!
Code:
With Sheets("Are")
LRb = .Range("B15").End(xlUp).Row + 1
For Each Area In Array("""AA""", """BB""", """CC""", """DD""", """EE""", """FF""", """GG""", """HH""", """II""")
.Range("B" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & FinCompPcRng & "))")
.Range("C" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & FinCompNoRng & "))")
.Range("D" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & FinCompValRng & "))")
.Range("E" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & TimeCompPcRng & "))")
.Range("F" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & TimeCompNoRng & "))")
.Range("G" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & TimeCompValRng & "))")
.Range("H" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & SubCompPcRng & "))")
.Range("I" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & SubCompNoRng & "))")
.Range("J" & LRb).Value = Application.Evaluate("SUMPRODUCT((" & WeekRng & "=" & LW & ")*(" & AreaRng & "=" & Area & ")*(" & SubCompValRng & "))")
Next Area
End With
End Sub