So this is the first ever post I have made to a forum. I am a total beginner to VBA. This is real simple I am sure. Not sure why I am getting an error, seems rather straightforward to me! I left my first attempt at average in there although at this point I am assuming that doesn't work for seem reason as current attempt. Also, is there a VBA function for average or we have to use the application average? Thanks
Sub Macro2()
' Macro2 Macro
Dim A As Long
A=100
For i = 1 To A
If Not (IsNumeric(Cells(i, 3).Value)) Then
Cells(i, 3).Value = ((Cells(i + 1, 3) + Cells(i - 1, 3))) / 2
'Cells(i, 3).Value = Application.Average(Range(Cells(i+1,3),Cells(i-1,3))
End if
Next i
End Sub
Bookmarks