|
Sub 路径统计()
'每个月路径统计方法,2019-6-18
Cells(Rows.Count, "c").End(xlUp).Offset(1, 0) = WorksheetFunction.Sum(Range("C4"), Range("C4").End(xlDown))
'选中c列并对C列有效数据求和
Cells(Rows.Count, "d").End(xlUp).Offset(1, 0) = WorksheetFunction.Sum(Range("d4"), Range("d4").End(xlDown))
'选中d列并对d列有效数据求和
Cells(Rows.Count, "e").End(xlUp).Offset(1, 0) = WorksheetFunction.Sum(Range("e4"), Range("e4").End(xlDown))
'选中d列并对e列有效数据求和
Cells(Rows.Count, "f").End(xlUp).Offset(1, 0) = WorksheetFunction.Sum(Range("f4"), Range("f4").End(xlDown))
'选中f列并对e列有效数据求和
Cells(Rows.Count, "g").End(xlUp).Offset(1, 0).Select
'选中g列并对e列有效数据求和
Cells(Rows.Count, "g").End(xlUp).Offset(1, 0) = "=Cells(Rows.Count, "d").End(xlUp).Offset(1, 0)"/Cells(Rows.Count, "c").End(xlUp).Offset(1, 0)"
想在g列最后一个非空单元格的下一格求出,d列总和除c列总和。c列和d列总和已经在上面的代码求出了。我需要附值给常量i或t吗?
|
|