+ Reply to Thread
Results 1 to 2 of 2

Macro to delete rows ONLY if condition is met

  1. #1
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Smile Macro to delete rows ONLY if condition is met

    Hi all,

    I already have a macro that will delete the selected row when the user clicks the relevant button. What I want to build into the macro, is a safeguard that will prevent certain rows from being deleted. Basically in column A (hidden) there is a number above 0 on those rows that I don't want the user to be able to delete. So, say the user is currently in cell B* and clicks on the "delete row" button, the code needs to say "if cell A* is more than zero an error message will appear that the user then just presses OK to and that's that. If it's not more than zero then it will move on to my code to delete that row". Hope that makes sense!

    Thanks for your help!

    Last edited by lealea1982; 04-02-2013 at 06:21 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Macro to delete rows ONLY if condition is met

    Put this at the beginning of your sub


    Please Login or Register  to view this content.
    Elegant Simplicity............. Not Always

+ 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