如果第一列值相同,那么从第4列开始平均,其实每天就6个时间段,所以就是6个一平均,但是程序写出来不能运行,也不报错,哪位gg帮我看看 Sub 平均() j = 2 m = 2 n = 1 sign = 123 While Sheet1.Cells(j, 1).Value <> "" If Sheet1.Cells(j, 1).Value = sign Then Sheet2.Cells(m, n + 3) = Application.WorksheetFunction.Sum(Range(Sheet1.Cells(j, n + 3).Value, Sheet1.Cells(j + 5, n + 3).Value)) / 6 n = n + 1 Else j = j + 6 m = m + 1 n = 1 End If sign = Sheet1.Cells(j, 1) Wend End Sub 写出来的后好像不能运行,不知道为什么,详细请见附件
2HELMHWm.rar
(14.61 KB, 下载次数: 10)
|