+ Reply to Thread
Results 1 to 4 of 4

Prevent data being deleted after Enter & Save

  1. #1
    Registered User
    Join Date
    09-24-2010
    Location
    Victoria, BC
    MS-Off Ver
    Excel 2007
    Posts
    68

    Prevent data being deleted after Enter & Save

    I am creating a simple workbook with 4 possible entry categories; Date, Cash In, Cash Out, Comment.
    What I need is to have the data automatically posted to the next blank line when entered, and not permit deletion. I need to do this to avoid any of the committee members trying to modify the books to help their wallets. Is there a simple way of doing this or am I looking at some complicated VBA?
    Last edited by Unca Wook; 08-19-2012 at 07:58 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Prevent data being deleted after Enter & Save

    Hi,

    No the VBA isn't complicated. But of course the most you can do is protect the worksheet with a password. Which is fine for non teccy/VBA gurus, but there are hacks out there which will crack Excel passwords, so ultimately it's not safe.

    What you need to do is.

    1. Name your 4 cell entry range say "Input"
    2. Format all four cells so that they are NOT locked
    3. Add a button which will run the 'AddRecord' macro
    4. Password protect the worksheet
    5. Add the following macro - note it assumes the new entry goes into the next available cell in column A

    Please Login or Register  to view this content.
    6. Now in the VBE (macro) environment, from the menu choose Tools, VBA Project Properties, Protection Tab - and select the 'Lock Project for Viewing and add a password. This will hide the VBA code above from someone who knows about VBA.

    Then your users can just enter data and click the 'Add Record' button.
    Last edited by Richard Buttrey; 08-19-2012 at 07:05 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Prevent data being deleted after Enter & Save

    Hi Unca Wook,

    These event codes might do the trick on a protected or unprotected sheet:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    09-24-2010
    Location
    Victoria, BC
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Prevent data being deleted after Enter & Save

    Richard thank you. That works like a charm.

+ 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