2017-06-14

EXCEL - Macro/sub to delete partially selected rows

Sub sDeleteRows()
    rngStart = Selection.Cells(1, 1).Address
    rngEnd = Selection.Cells(Selection.Rows.Count, Selection.Columns.Count).Address
    firstRowNumber = getRow(rngStart)
    lastRowNumber = getRow(rngEnd)
    Rows(firstRowNumber & ":" & lastRowNumber).EntireRow.Delete
End Sub

No comments:

Post a Comment