Hi,
I am looking for a tool that can automatically multiply one cell with several others depending on the year. I have been able to make it multiply with the correct values individually. But I need it to multiply the price with the value for each year at the same time (see the screenshot I attached), instead of individually as it does now.
I created a loop for it to find the correct year and values to multiply with. But I need help getting it to do exactly what I want. Hope someone is able to help me.
I am looking for a tool that can automatically multiply one cell with several others depending on the year. I have been able to make it multiply with the correct values individually. But I need it to multiply the price with the value for each year at the same time (see the screenshot I attached), instead of individually as it does now.
I created a loop for it to find the correct year and values to multiply with. But I need help getting it to do exactly what I want. Hope someone is able to help me.
VBA Code:
Sub calculate ()
ActiveCell.Offset(0,1).Select
Dim Cell As Range
For Each Cell In Range("F5:F24")
If Cell.Value < Range("B7").Value Then
ElseIf Cell.Value >= Range("B7") Then
Cell.Offset(0,4).Value = Range("B8") * Cell.Offset(0,1).Value
End If
Next Cell
End Sub