Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, I hope this is something obvious, but I can’t see it,effectively the basic formula works, but when I transpose that to vba, thecolumn just remains blank.
Effectively, I want the sum of the figures in column Q,where column G matches the name in the relevant line in the first line managerspreadsheet.
=SUMIFS(Hierarchy!Q:Q,Hierarchy!G:G,'First Line manager'!A2)
Any help appreciated.
Effectively, I want the sum of the figures in column Q,where column G matches the name in the relevant line in the first line managerspreadsheet.
=SUMIFS(Hierarchy!Q:Q,Hierarchy!G:G,'First Line manager'!A2)
Code:
Dim lastrowcolumnd As Long
lastrowcolumnd = Range("a" &Rows.Count).End(xlUp).Row
For z = 2 To lastrowcolumnd
Sheets("first line Manager").Select
Cells(z, 3) = WorksheetFunction.SumIfs(ThisWorkbook.Sheets("Hierarchy").Range("q:q"),ThisWorkbook.Sheets("Hierarchy").Range("G:G"),ThisWorkbook.Sheets("First line manager"), Cells(z, 1))
Last edited by a moderator: