View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Roger on Excel Roger on Excel is offline
external usenet poster
 
Posts: 249
Default Deleting Empty Rows using VBA code without the need to activat

Many Thanks Marcus - Have a great week

Roger

"marcus" wrote:

Hi Roger

Here is the procedure which will work only on those sheets which start
with 'St' Adjust to suit. If you have sheets you don't want it to
work on which do start with St let us know.

Take care
Marcus


Option Explicit
Option Compare Text
Sub DelBlankColB()

Dim lw As Integer
Dim ws As Worksheet

Application.ScreenUpdating = False

For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 2) = "St" Then
lw = ws.Range("B" & Rows.Count).End(xlUp).Row
ws.Range("B1:B" & lw).SpecialCells
(xlCellTypeBlanks).EntireRow.Delete
End If
Next ws

End Sub
.