Delete Rows: (Work backwards)
Sub DeleteTheBlankRows()
'Note: iRe1 is hard coded (+Assumes Header is Row 1)
Dim Ws1 As Long, iLoop As Long, iRe1 as long
'Set Worksheet Object
Ws1 = Worksheets("TestDeleteWS").Index
iRe1 = 30
'Loop through (End to Start)
For iLoop = iRe1 To 2 Step -1
'Delete if value in Column A is [Blank]
If Worksheets(Ws1).Cells(iLoop, 1) = "" Then Rows(iLoop).Delete shift:=xlUp
Next iLoop
End Sub
'Note: iRe1 is hard coded (+Assumes Header is Row 1)
Dim Ws1 As Long, iLoop As Long, iRe1 as long
'Set Worksheet Object
Ws1 = Worksheets("TestDeleteWS").Index
iRe1 = 30
'Loop through (End to Start)
For iLoop = iRe1 To 2 Step -1
'Delete if value in Column A is [Blank]
If Worksheets(Ws1).Cells(iLoop, 1) = "" Then Rows(iLoop).Delete shift:=xlUp
Next iLoop
End Sub
Delete Rows: Rows(2:4) - dynamic
Sub DeleteRows_DynamicRange()
Dim iRowStart As Long, iEnd As Long
iRowStart = 12
iEnd = 14
Range(Cells(iRowStart, 1), Cells(iEnd, 1)).EntireRow.Delete Shift:=xlUp
End Sub
Dim iRowStart As Long, iEnd As Long
iRowStart = 12
iEnd = 14
Range(Cells(iRowStart, 1), Cells(iEnd, 1)).EntireRow.Delete Shift:=xlUp
End Sub