+ Reply to Thread
Results 1 to 4 of 4

How to prevent the last row of a range from being deleted ?

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    Scotland
    MS-Off Ver
    O365
    Posts
    4

    How to prevent the last row of a range from being deleted ?

    Hi all,

    I have two ranges which I would like my users to be able to Insert or Delete the last row but to keep the formatting of the inserted row from the one above.
    The code seems to work fine but it does not prevent the user from deleting the last row. Once this is done I think the code looses it’s reference points and then it all goes wrong. I would be grateful if someone can tell me how to prevent the last row in the range from being deleted. Cell C32 is the top left cell start of my range. Any simplification on my code would also be welcome.


    Please Login or Register  to view this content.

    Thanks
    Last edited by Greycom4; 08-19-2013 at 04:46 PM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to prevent the last row of a range from being deleted ?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    08-08-2013
    Location
    Scotland
    MS-Off Ver
    O365
    Posts
    4

    Re: How to prevent the last row of a range from being deleted ?

    Sorry about that, I did wonder how that was done.

  4. #4
    Registered User
    Join Date
    08-08-2013
    Location
    Scotland
    MS-Off Ver
    O365
    Posts
    4

    Re: How to prevent the last row of a range from being deleted ?

    Perhaps I have not explained this very well. My code works in that I can delete the last row in the range which is fine, however if the range contains the first row with headers and 4 rows with details, I want the user to be able to remove the last three rows (one at a time) until they get to the last row. I need to prevent the users from deteling the last row of details in the range so they are left with the headers and one row of data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Prevent rows being deleted
    By Crüe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2011, 05:19 AM
  2. Prevent sheets from being deleted
    By LAF in forum Excel General
    Replies: 1
    Last Post: 02-01-2010, 04:12 PM
  3. prevent a special cell from being deleted
    By jagexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2006, 07:35 PM
  4. [SOLVED] How do i prevent a formula in excel from being deleted?
    By Sarah in forum Excel General
    Replies: 2
    Last Post: 06-09-2005, 09:05 PM
  5. [SOLVED] Prevent a file being deleted
    By Rod Jones in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2005, 09:06 AM

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