您可以尝试以下方法:
Dim MyRange As Range
Dim iCounter As Long
Set MyRange = ActiveSheet.UsedRange
For iCounter = MyRange.Rows.Count To 1 Step -1
If Application.CountA(Rows(iCounter).EntireRow) = 0 Then
Rows(iCounter).EntireRow.Hidden = True
End If
Next iCounter