Private Sub CommandButton1()
Dim myFormula As String
myFormula = "=IF(ISNA(INDIRECT(""K""&MATCH(M2;B:B;0)));0;INDIRECT(""K""&MATCH(M2;B:B;0)))"
Range("L2").Select
Range("L2").Formula = myFormula
End Sub
When I start this macro code I have error 1004. If I remove from string initialization “=” then in cell “L”” I have regular string witch is not formula.
Solved by O. J. in 11 mins