Sub pDelBlnkRws()
Dim lngMaxR As Long
Dim lngC As Long
Dim rngStart As Range
On Error GoTo lblError3
Set rngStart = Sheet1.Range("A" & Sheet1.Rows.CountLarge)
For lngC = 1 To 11
If rngStart.End(xlUp).Row > lngMaxR Then
lngMaxR = rngStart.End(xlUp).Row
End If
Set rngStart = rngStart.Offset(ColumnOffset:=1)
Next
For lngC = lngMaxR To 1 Step -1
With Sheet1
If Application.WorksheetFunction.CountA(.Range("A" & lngC).EntireRow) = 0 Then
.Range("A" & lngC).EntireRow.Delete
End If
End With
Next
lblError3:
If Err.Number <> 0 Then
MsgBox "Error Number:" & Err.Number & vbCrLf & "Error Description: " & Err.Number
End If
End SubTuesday, December 24, 2024
VBA Excel - delete blank rows from Excel sheet:
The following code deletes blank rows from Excel sheet:
Subscribe to:
Post Comments (Atom)
Hot Topics
-
By Ajeet Kumar RADAR CHART In radar chart, the categorical variable is displayed as spikes radiating from a central point. The values o...
-
In the previous post we have learnt about SSMS (SQL Server Management Studio) and how to connect with a SQL Server instance. In this post w...
-
The @page directive The @page directive in ASP.NET Core Razor Pages is crucial because it designates a Razor file as a Razor Page, allowin...
No comments:
Post a Comment