+ Reply to Thread
Results 1 to 4 of 4

Alert if User Attempts to Delete Row Containing Named Range

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Alert if User Attempts to Delete Row Containing Named Range

    Title says it all:

    How would one initiate an alert if a user attempts to delete a row containing a Global Named Range? I would assume this would be a Worksheet_BeforeRightClick event?

    Thanks,
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Alert if User Attempts to Delete Row Containing Named Range

    24-hr bump

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Alert if User Attempts to Delete Row Containing Named Range

    Try:

    Please Login or Register  to view this content.
    In this example named range is called "myRange". This won't prevent them from deleting the rows, just alerts them if they do. Would be best just to lock the rows you don't want deleted.

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Alert if User Attempts to Delete Row Containing Named Range

    How does the attached workbook work for you? (It's not fool-proof because it checks every named range in the workbook for errors instead of the row required but it should give you a head start).

    P.S. It would be much easier just to protect the required row and worksheet.
    Attached Files Attached Files
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1