
Sub hh()
Application.ScreenUpdating = False
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If Cells(i, 1) = "" Then
Rows(i).Delete
End If
Next
Application.ScreenUpdating = True
End Sub |
Public Sub cancella_righe_vuote()
Dim sh As Worksheet
Dim t As Double
Set sh = ThisWorkbook.Worksheets("Foglio1")
Application.ScreenUpdating = False
With sh
.Range("A1").AutoFilter , Field:=1, Criteria1:=""
.Range("A1").CurrentRegion.SpecialCells( _
xlCellTypeVisible).Rows.EntireRow.Delete
End With
Application.ScreenUpdating = True
MsgBox Timer - t
Set sh = Nothing
End Sub
|
Sub hh()
Application.ScreenUpdating = False
For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If Trim(Cells(i, 1)) = "" Then
Rows(i).Delete
End If
Next
Application.ScreenUpdating = True
End Sub |
With sh
.Range("A1").Offset(1).AutoFilter , Field:=1, Criteria1:=""
.Range("A1").Offset(1).CurrentRegion.SpecialCells( _
xlCellTypeVisible).Rows.EntireRow.Delete
End With |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Sub EliminaVuote()
Dim rng As Range
Dim rngEmpty As Range
Dim nLR As Long
nLR = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range("A1:A" & nLR)
On Error GoTo err_sub
Set rngEmpty = rng.SpecialCells(xlCellTypeConstants, xlTextValues)
rngEmpty.EntireRow.Delete
err_sub:
If Err.Number <> 0 Then MsgBox Err.Description, vbCritical
Set rng = Nothing
Set rngEmpty = Nothing
End Sub
|
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Sub EliminaVuote()
Dim rng As Range
Dim rngEmpty As Range
Dim nLR As Long
nLR = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range("A2:A" & nLR)
On Error GoTo err_sub
Set rngEmpty = rng.SpecialCells(xlCellTypeConstants, xlTextValues)
rngEmpty.EntireRow.Delete
err_sub:
If Err.Number <> 0 Then MsgBox Err.Description, vbCritical
Set rng = Nothing
Set rngEmpty = Nothing
End Sub |
