Hello I am trying to delete rows in the range from 7 to 31 if the data in column A is blank. However i want this to run all worksheets other than the ones i specify. I have attempted the code but it doesn't work, can anyone give me a pointer on where i went wrong? Also should i be putting an error handling for if there isn't any blank cells?
Sub deletespaces()
Dim ws As Worksheet
Dim rng As Range
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Menu" And ws.Name <> "Paste here" And ws.Name <> "Data" Then
Range("a7:A31").Select
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End If
Next ws
End Sub