View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

Hi,

A look at your code would have been helpful. Does this help?

Sub stance()
myrow = ActiveCell.Row
If myrow <= 20 Then
MsgBox "You can't delete a row number less than 20"
Else
Rows(myrow).EntireRow.Delete
End If
End Sub

Mike

"K" wrote:

Hi, I have two macros set on two buttons in my spreadsheet. One macro
add entire row and one macro delete entire row. I want macro in my
Sheet Module that if I cross deleting rows by deleting row macro from
Row 20 in sheet then Message should come up saying that "YOU CANT
DELETE ROWS FROM THIS LINE" and undo the delete row. But below from
Row 20 it should not say anything. Please if anybody help. Thanks