Selection.FormulaArray ="=LINEST(M3:M" & n & ",G3:H" & n & ",1,1)"
Selection.FormulaArray ="=LINEST(M3:M" & n & ",G3:H" & n &",1,1)"
改成"=LINEST(M3:M"&trim(n)&",G3:H"&trim(n)&",1,1)"试试看。