I am trying to input a formula with variants in a cell, but when I run the code I get formula’s result in a cell, not formula itself.
Is it possible to change my code so it does what I need?
I need to check column’s header in row 6, if it’s value is “Forecast”, multiplication formula should be placed in rows below.
(Number of sales for each day in row 9 multiplied by a value in column 39 – resulting formula inserted in every cell in my established range)
Dim ShMonth As Worksheet
Set ShMonth = ThisWorkbook.Worksheets("Month")
Dim c As Long
Dim r As Long
For c = 7 To 37
For r = 12 To 53
If ShMonth.Cells(6, c).Value = "Forecast" Then
ShMonth.Cells(r, c).Formula = "=" & ShMonth.Cells(9, c) & "*" & ShMonth.Cells(r, 39)
End If
Next r
Next c