Hi All,
I am new in VBA programming and I am wondering if the below coding can be applied in a almost similar way to SumProduct calculation:
I am using the above code to Sum a number of cartons.
If I need to calculate the sumproduct between cycle time(col10) and the number of carton(col13) to define the average cycle time of one carton, the formula would be: =Sumproduct(cycle time(col10)*Cartons(col13))/Total Cartons(col13). + insert the result in (col10)
So, does the above coding could be applied in a similar way to Sumproduct calculation, knowing that, as per my formula the overall result is subjected of the result of the Sum of number of carton.
Thanks in advance for your feedback.
Lomic6
I am new in VBA programming and I am wondering if the below coding can be applied in a almost similar way to SumProduct calculation:
Code:
Sub sbttls()
For Each aArea In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants).Areas
Rows(aArea.Row + aArea.Rows.Count).Font.ColorIndex = 5
Rows(aArea.Row + aArea.Rows.Count).Font.Bold = True
cells(aArea.Row + aArea.Rows.Count, 13).Formula = "=SUM(" & Range(cells(aArea.Row, 13), cells(aArea.Row + aArea.Rows.Count - 1, 13)).Address & ")"
cells(aArea.Row + aArea.Rows.Count, 14).Formula = "=SUM(" & Range(cells(aArea.Row, 14), cells(aArea.Row + aArea.Rows.Count - 1, 14)).Address & ")"
cells(aArea.Row + aArea.Rows.Count, 19).Formula = "=SUM(" & Range(cells(aArea.Row, 19), cells(aArea.Row + aArea.Rows.Count - 1, 19)).Address & ")"
cells(aArea.Row + aArea.Rows.Count, 20).Formula = "=SUM(" & Range(cells(aArea.Row, 20), cells(aArea.Row + aArea.Rows.Count - 1, 20)).Address & ")"
Next aArea
End Sub
I am using the above code to Sum a number of cartons.
If I need to calculate the sumproduct between cycle time(col10) and the number of carton(col13) to define the average cycle time of one carton, the formula would be: =Sumproduct(cycle time(col10)*Cartons(col13))/Total Cartons(col13). + insert the result in (col10)
So, does the above coding could be applied in a similar way to Sumproduct calculation, knowing that, as per my formula the overall result is subjected of the result of the Sum of number of carton.
Thanks in advance for your feedback.
Lomic6