score:2

Accepted answer
Option Explicit

Sub test()

Dim r6 As Range, r7 As Range
Dim ws As Worksheet
Dim LastRow As Long
Dim printareaP As Range, Cell As Range

Set ws = ThisWorkbook.Worksheets("Pricelist")



LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
Set printareaP = ws.Range(ws.Cells(1, 1), ws.Cells(LastRow, 1))

For Each Cell In printareaP
    If IsNumeric(Cell.Value) Then
        ws.Cells(Cell.Row - 1, 1).EntireRow.Delete
    End If
Next Cell


End Sub

score:1

Sub DeleteRowAbove()

    Dim r6 As Range, r7 As Range

    With ThisWorkbook.Worksheets("Pricelist").Range("Print_Area")

        For Each r6 In .Range("A2", .Range("A" & .Rows.Count).End(xlUp))
            If Not IsEmpty(r6) And IsNumeric(r6) Then
                If r7 Is Nothing Then
                    Set r7 = r6.Offset(-1, 0)
                  Else
                    Set r7 = Union(r7, r6.Offset(-1, 0))
                End If
            End If
        Next

    End With

    If Not r7 Is Nothing Then
        r7.EntireRow.Delete ' .Hidden = True 
        Set r7 = Nothing
    End If

End Sub

Related Articles