Hello,
Place this code in a module and run the one named MainCode
Private Sub deleteRows(sh As String, rStr As Long)
Dim lrow As Long
'determine what's the last row
lrow = Sheets(sh).Cells(Rows.Count, "A").End(xlUp).Row
'delete the range in case thre is more data specified than actual rows
On Error Resume Next
Sheets(sh).Cells(rStr + 1, "A").Resize(lrow - rStr, 1).EntireRow.Delete
End Sub
Sub MainCode()
Dim lr As Long
Dim r As Range
lr = Sheets("Stored values").Cells(Rows.Count, 1).End(xlUp).Row
For Each r In Sheets("Stored values").Range("A1:A" & lr)
If IsNumeric(r.Offset(0, 1).Value) Then
Call deleteRows(r.Value, r.Offset(0, 1).Value)
End If
Next
End Sub
Thanks
Bookmarks