I am trying to insert a formula into a cell. The code I am using inserts the code as a string so I get a $NAME error in the cell. Is there a way to fix this issue?
Code:
Sub InsertCells()
Dim LR As Long
Dim A1 As Long
' InsertCells Macro
' Macro recorded 4/22/2009 by
'
'LastRow = LR
LR = ActiveSheet.UsedRange.Rows.Count
A1 = LR - 200
Range("H" & LR).Value = "200 day Average"
Range("I" & LR).Value = "=SUM(E&A1:E&LR/200)"
End Sub