By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

expertatexcel.com

 


WrapEntireRowDelete


Function WrapEntireRowDelete(wbkname, sheetname, rowTodelete)
'This is a wrapper for deleting a row to prevent accidental deletion
'must pass the 3 params
If ActiveWorkbook.Name <> wbkname Then
    WrapEntireRowDelete = "error: not on the passed workbook '" & wbkname & "'"
    Exit Function
End If

If ActiveSheet.Name <> sheetname Then
    WrapEntireRowDelete = "error: not on propper sheet name '" & sheetname & "'"
    Exit Function
End If

Rows(rowToDelete).EntireRow.Delete
WrapEntireRowDelete = "ok"
End Function