B
Broxterman
I am a little new to macros and I am having trouble using a suggested
macro in my spreadsheet. My simple question is what do I need to do to
change the following macro so that it will work on my spreadsheet.
Sub DeleteEmptyRows(DeleteRange As Range)
' Deletes all empty rows in DeleteRange
' Example: DeleteEmptyRows Selection
' Example: DeleteEmptyRows Range("A1
100")
Dim rCount As Long, r As Long
If DeleteRange Is Nothing Then Exit Sub
If DeleteRange.Areas.Count > 1 Then Exit Sub
With DeleteRange
rCount = .Rows.Count
For r = rCount To 1 Step -1
If Application.CountA(.Rows(r)) = 0 Then
..Rows(r).EntireRow.Delete
End If
Next r
End With
End Sub
I simply want to delete every row in column B5:20 in my spreadsheet
that does not contain a value. Please let me know what I need to
insert into the above macro to do this.
Thanks so much.
macro in my spreadsheet. My simple question is what do I need to do to
change the following macro so that it will work on my spreadsheet.
Sub DeleteEmptyRows(DeleteRange As Range)
' Deletes all empty rows in DeleteRange
' Example: DeleteEmptyRows Selection
' Example: DeleteEmptyRows Range("A1

Dim rCount As Long, r As Long
If DeleteRange Is Nothing Then Exit Sub
If DeleteRange.Areas.Count > 1 Then Exit Sub
With DeleteRange
rCount = .Rows.Count
For r = rCount To 1 Step -1
If Application.CountA(.Rows(r)) = 0 Then
..Rows(r).EntireRow.Delete
End If
Next r
End With
End Sub
I simply want to delete every row in column B5:20 in my spreadsheet
that does not contain a value. Please let me know what I need to
insert into the above macro to do this.
Thanks so much.