+ Reply to Thread
Results 1 to 12 of 12

hide or prevent deletion of formulas in cells

  1. #1
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    hide or prevent deletion of formulas in cells

    From what i`ve experienced, if you protect parts of a sheet (table or raw range) that feeds a pivot table, the pivot table no longer updates.

    However I want to protect formula`s that run down certain columns in a TABLE from being edited or deletable. But also have those formulas continue down their column if I add insert more rows within the table .(Possible?). I find those new rows do not carry the formulas down from above them.

    Is there also a way to prevent those formulas from being seen at the same time?

    Thankyou.
    Last edited by jitterbug888; 04-19-2020 at 01:25 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: hide or prevent deletion of formulas in cells

    Probably a MAC issue, I never experienced issues with protected sheets and pivot tables.
    Once a sheet is protected and you also select the hide option, the formulas won't show
    Without a sample file, I'm afraid I can't help, and also, I don't know if this could be a MAC issue, I'm a Windows user
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    apologies I updated my user profile I use pc office 365 now.

    Ok good to know i`ll need to test from scratch on another sheet.
    Will get back...

  4. #4
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    Keeb here is my table, if I add a new row in the middle of the table, the formulas dont carry down to fill the new rows...(if I protect the sheet).
    I want to have the formula`s hidden, and the columns D E F locked.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: hide or prevent deletion of formulas in cells

    Okay, you're doing this without macros.
    If you're the only one that is going to add or delete rows then you need to protect the worksheet.
    It's protected now (no password).
    Step 1: Unprotect the worksheet
    Step 2: select the table and insert a row in the table area (I did and you see that the formula is copied)
    Step 3: protect the worksheet

    Now the columns with formulas are locked and the formulas invisible.
    Just enter the date in the unlocked cells and it all works, repeat this for every row you want to add or add a series of rows and then protect the worksheet before entering data.
    This works.

    I do see that you don't treat your cell content nicely, as you see from the row I added the last column says 800. You should add and if condition to not do anything if one or more of the required columns with data is empty
    Last edited by Keebellah; 04-19-2020 at 03:16 AM. Reason: Typing error

  6. #6
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    Thanks Keeb, that gives me some insight I should work at macro`s now learning VBA to script an autofill of formula down so that I dont have to unprotect the sheet, as I wanted to share future sheets with people who dont know formulas or excel well. Thanks for the help.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: hide or prevent deletion of formulas in cells

    When you design an actual table the formulas in the column(s) ALWAYS copies itself unless you edit something in the rows below.
    VBA does help and you can do much more like editing and changing things in protected sheet, if coded correctly you don't even have to unprotect the sheet
    Never too old to learn , there are loads of VBA tutorials and all very clear, you should visit Ron de Bruin's site may samples and also MAC / Windows compatibility issues are explained

  8. #8
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    Thanks Keeb! And for the De Bruin info, cheers.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: hide or prevent deletion of formulas in cells

    Just for fun, here's my idea for inserting or appending row or rows to the table.
    Happy coding

  10. #10
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    WOW thats GOLD and I can learn from the vba too, thanks Keeb. Really appreciate that!.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: hide or prevent deletion of formulas in cells

    If you noticed, then you'll see that if the selected cell is outside the table you get the question if you want to append row or rows to the table.
    If the selected cell is inside the table area the prompt is if you want to insert a row or rows above that point in the table.

    VBA is quite straight forward and logic.
    Happy coding

  12. #12
    Forum Contributor
    Join Date
    04-01-2015
    Location
    Sydney Australia
    MS-Off Ver
    Office 365 latest
    Posts
    171

    Re: hide or prevent deletion of formulas in cells

    I think thats awesome when I messed around with the sheet, and given me more inspiration as I started a vba course! Thanks Keebs,

+ 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. [SOLVED] Prevent Deletion of Row
    By tarekgemayel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2014, 01:40 PM
  2. Prevent workbook deletion or create the copy upon the deletion?
    By ciapul12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2014, 04:35 PM
  3. Prevent formula deletion without using locked cells and sheet protection
    By Richard Buttrey in forum Tips and Tutorials
    Replies: 7
    Last Post: 01-09-2013, 10:24 AM
  4. Prevent deletion of Chart
    By jensenleesen in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-15-2010, 07:01 AM
  5. Prevent Sheet Deletion
    By T-Žex in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-16-2009, 11:37 AM
  6. Prevent Sheet Deletion
    By jubi23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2008, 04:03 PM
  7. [SOLVED] Prevent deletion Comments
    By Sige in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2005, 11:05 AM

Tags for this Thread

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