In Excel VBA, I'm trying to insert a formula into a cell, but I'm getting an error. When I look at the cell value, the formula has an @
placed in it which I guess is causing the error.
My code reads:
Range("D7").Formula = "=AVG(D10:D29)"
When I run the macro, I get an #NAME?
error in the cell and when I look at the formula inserted in the cell it reads:
=@AVG(D10:D29)
I'm not sure where the @
came from. I've checked several places on the internet and my VBA code appears to be correct. Can anyone tell me what I'm missing?