Untitled
unknown
plain_text
9 months ago
495 B
4
Indexable
Private Sub RemoveBlankCountryRows(wsReport As Worksheet, startCol As Long, endCol As Long)
Dim lastRow As Long, i As Long
lastRow = wsReport.Cells(wsReport.Rows.Count, 1).End(xlUp).Row
' Loop from the bottom to the top to avoid shifting rows during deletion
For i = lastRow To 4 Step -1
If WorksheetFunction.CountA(wsReport.Range(wsReport.Cells(i, startCol), wsReport.Cells(i, endCol))) = 0 Then
wsReport.Rows(i).Delete
End If
Next i
End SubEditor is loading...
Leave a Comment