Results 1 to 5 of 5

locking worksheet deletes cell formulas

Threaded View

JanezP locking worksheet deletes... 11-18-2010, 10:21 AM
jaslake Re: locking worksheet deletes... 11-18-2010, 05:23 PM
JanezP Re: locking worksheet deletes... 11-19-2010, 03:00 AM
JanezP Re: locking worksheet deletes... 11-19-2010, 10:28 AM
jaslake Re: locking worksheet deletes... 11-19-2010, 10:50 AM
  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:
    Set ws = Application.ActiveWorkbook.ActiveSheet
    
    Worksheets("Matrika").Unprotect Password:="kas"
    
    Application.ScreenUpdating = False
    
        i = 10
        Do While ws.Cells(i, 1) <> "xxx"
                i = i + 1
        Loop
        
        Rows("" & i - 1 & ":" & i - 1 & "").Select
        Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
        
        ws.Rows(i - 2).Copy ws.Rows(i - 1)
        
        For j = 1 To 64
          ws.Cells(i - 1, j) = Clear
        Next
        
    Application.ScreenUpdating = True
    
    Worksheets("Matrika").Protect Password:="kas"
    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

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