0

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?

GSerg
  • 76,472
  • 17
  • 159
  • 346
Ross from Brooklin
  • 293
  • 1
  • 5
  • 18
  • does this help at all: https://stackoverflow.com/questions/61269296/appearing-when-inserting-formula-with-vba-in-excel?rq=1 – sous2817 Mar 10 '23 at 18:06

0 Answers0