Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

Hi

Try this before the delete statement.

If activecell.row<= 20 then
msgbox ("You cant delete ....")
exit macro
end if

Regards,

Per

"K" skrev i meddelelsen
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

On Mar 26, 9:28*am, "Per Jessen" wrote:
Hi

Try this before the delete statement.

If activecell.row<= 20 then
* * msgbox ("You cant delete ....")
* * exit macro
end if

Regards,

Per

"K" skrev i ...



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- Hide quoted text -


- Show quoted text -


please see the code below the one delete the rows. I have tried
putting macro the one you told me but its not working.
Sub DeleteLines()
Dim StartRow As Long
StartRow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(StartRow, 1).EntireRow.Delete
End Sub
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

Maybe

Sub DeleteLines()
Dim StartRow As Long
StartRow = Cells(Rows.Count, 2).End(xlUp).Row
If StartRow = 20 Then
Cells(StartRow, 1).EntireRow.Delete
Else
MsgBox "You can't delete a row under 20"
End If
End Sub

Mike

"K" wrote:

On Mar 26, 9:28 am, "Per Jessen" wrote:
Hi

Try this before the delete statement.

If activecell.row<= 20 then
msgbox ("You cant delete ....")
exit macro
end if

Regards,

Per

"K" skrev i ...



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- Hide quoted text -


- Show quoted text -


please see the code below the one delete the rows. I have tried
putting macro the one you told me but its not working.
Sub DeleteLines()
Dim StartRow As Long
StartRow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(StartRow, 1).EntireRow.Delete
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default UNDO DELEING ROW AND POPUP WARNING MESSAGE

On Mar 26, 10:15*am, Mike H wrote:
Maybe

Sub DeleteLines()
Dim StartRow As Long
StartRow = Cells(Rows.Count, 2).End(xlUp).Row
If StartRow = 20 Then
* * Cells(StartRow, 1).EntireRow.Delete
Else
* * MsgBox "You can't delete a row under 20"
End If
End Sub

Mike



"K" wrote:
On Mar 26, 9:28 am, "Per Jessen" wrote:
Hi


Try this before the delete statement.


If activecell.row<= 20 then
* * msgbox ("You cant delete ....")
* * exit macro
end if


Regards,


Per


"K" skrev i ...


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- Hide quoted text -


- Show quoted text -


please see the code below the one delete the rows. *I have tried
putting macro the one you told me but its not working.
Sub DeleteLines()
Dim StartRow As Long
StartRow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(StartRow, 1).EntireRow.Delete
End Sub- Hide quoted text -


- Show quoted text -


Thanks Mike that what i want
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup message when value changes mrbalaje Excel Programming 3 March 22nd 08 05:51 PM
How to turn off the popup warning when clicking on a hyperlink pschurb Excel Worksheet Functions 2 May 7th 06 04:36 PM
How to stop the popup warning window when clicking on a hyperlink pschurb Excel Programming 1 May 5th 06 09:08 PM
Add a warning popup to a Macro Button Teresa Excel Worksheet Functions 4 January 16th 06 09:27 PM
Protection and warning popup Ken Excel Discussion (Misc queries) 5 December 7th 05 03:22 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"