我有以下代码:
Case "END-BOX"
EndBox = ActiveCell.Row
Selection.Offset(-1, 2).Select
Selection.ClearContents
Rows(2).Insert Shift:=xlDown
TotalCols = ActiveSheet.UsedRange.Columns.Count
Col = 4
Cells(EndBox, Col).Select
For i = EndBox To 1 Step -1
If Cells(i, Col).Value <> "" Then
n = n + 1
Else
Cells(i, Col).Value = n
If Cells(i, Col).Offset(0, -2).Value = "NEW-BOX" Then Cells(i, Col).Interior.ColorIndex = 4
n = 0
' Application.Speech.Speak (n)
End If
Next
Range(EndBox).Select
Selection.Offset(1, -2).Select
我想弄清楚如何在计算总和后自动读出最终的总和数,但是这个循环给我带来了麻烦,我不明白我将如何实现它。任何帮助将不胜感激。