- 行の大きなセットがあり
Excel、間に空の行があります。 - だから私はその空の行をグループとして数えたい.
 - すべてのグループ数を行の上に置き、空の行をすべて削除します。
 
元。
- データ行。
 - データ行。下のすべての空の行を数えたい.その行のセルに置く (3)
 - 空の 。
 - 空の 。
 - 空の 。
 - データ行。
 - データ行。
 - データ行。
 - データ行。(2)。
 - 空行。
 - 空行。
 - データ行。(4)
 - 空の。
 - 空の。
 - 空の。
 - 空の。
 - .
 - .
 - .
 - .
 - 等
 
Excel、間に空の行があります。元。
スプレッドシートの列 A (セル A1 から始まる) にデータがあり、次のように空白を数えて行を削除するとします。
      Col A    Col B                          Col A      Col B
1     AAA                                     AAA        2
2                                             BBB        1
3                                             CCC        0
4     BBB                                     DDD        2
5                          ---- Output --->   EEE
6     CCC
7     DDD
8
9
10    EEE 
次のコードはその結果を達成します。
Sub CountEmptyRows()
    Dim lastRow As Long, rw As Long, count As Integer
    lastRow = Range("A65536").End(xlUp).Row - 1
    count = 0
    For rw = lastRow To 1 Step -1
        If IsEmpty(Cells(rw, 1)) Then //If cell is empty increment the count and delete the row
            count = count + 1
            Cells(rw, 1).EntireRow.Delete
        Else
            Cells(rw, 2) = count //Display emtpy row count and then reset counter
            count = 0
        End If
    Next rw
End Sub