+ Reply to Thread
Results 1 to 5 of 5

locking worksheet deletes cell formulas

  1. #1
    Registered User
    Join Date
    11-18-2010
    Location
    Trzin, Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    locking worksheet deletes cell formulas

    Helo!

    I created a macro to insert and delete lines in a worksheet. The code I used for insert is as follows:
    Please Login or Register  to view this content.
    This worksheet uses 64 columns and they are all filled with numbers. Numbers start at line 10. Bottom line sums each column. Macro counts how many rows there are and inserts a line before the line with sums, copies the line before the inserted one into the new one and clears cells. When I start putting numbers into the new line, bottom line sums update automaticaly.

    Now, my problem starts when I try to return protection to worksheet, whether I do it manually or with vba code, this action removes all sum formulas from my bottom line.

    If anyone knows why this might be happening, please post an answer

    Thanks.
    Last edited by Leith Ross; 11-18-2010 at 01:32 PM. Reason: Added Code Tags

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: locking worksheet deletes cell formulas

    Hi JanezP

    I have no idea.

    However, if you've not tried this, I suggest you comment out the Application.ScreenUpdating lines of code (both of them) and then step through the code to see what's "Actually" happening. Perhaps the sum formulas are getting cleared here
    Please Login or Register  to view this content.
    or perhaps not.

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    11-18-2010
    Location
    Trzin, Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: locking worksheet deletes cell formulas

    I've traced the code and formulas stay in last line until I lock my worksheet with:
    Worksheets("Matrika").Protect Password:="kas"

    Also formulas disappear when I try to lock them by using excel menus.
    Darn strange this is...

  4. #4
    Registered User
    Join Date
    11-18-2010
    Location
    Trzin, Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: locking worksheet deletes cell formulas

    Found it! Formatting on cells was set to hide when locked.. and to think I spent two days figuring out what was wrong..

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: locking worksheet deletes cell formulas

    Hi JanezP

    Glad you figured it out.

    John

+ 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