I have a repetitive task that I am trying to solve with a macro.
I have a cell with a number - let's say cell N4 holds 5782.3.
Now I would like to change the B4 cell content to =IF($K4<>0,5728.3,0)
How do i do it? I have tried the following:
Dim a As Double
a = ActiveCell.Value
ActiveCell.FormulaR1C1 = "=IF(RC4<>0,a,0)"
ActiveCell.Offset(1, 0).Range("A1").Select
But then I get in the cell IF($K4<>0,a,0) How should I write it?
Range("B4").Formula = "=IF($K4<>0," & Range("K4").Value & ",0)"?