方法一:Cells(i, 4) = "=countif(range(cells(2," & j + 2 & ") : cells(268," & j + 2 & "),cells( " & i & ",3))"方法二:Cells(i, 4) = Application.WorksheetFunction.CountIf(Range(Cells(2, j + 2), Cells(268, j + 2)), Cells(i, 3))