Sum units is expected result - there are over 2000 lines and i need to sum all per row with heading of "units"
what i am trying to achieve is to sum all cells in a row that has a header like "unit"
The amount of rows can be over 2000. I am stuck!!!!
VBA Code:
Sub GPSUM()
Columns("k:k").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("k5").Select
ActiveCell.FormulaR1C1 = "SumIf(Range("e1:AP1"), Range("*Unit*").Value, Range("e2:AP2"))"
what i am trying to achieve is to sum all cells in a row that has a header like "unit"
The amount of rows can be over 2000. I am stuck!!!!
e | f | g | h | i | j | k |
Units - 2021-01 | Sales -2021-01 | Units - 2021-02 | Sales -2021-02 | Units - 2021-02 | Sales -2021-03 | total sum for units |
1 | 2 | 3 | 4 | 5 | 6 | 9 |
7 | 8 | 9 | 1 | 2 | 3 | 18 |
4 | 5 | 6 | 7 | 8 | 9 | 18 |