Results 1 to 6 of 6

Thread: How to insert row and copy formula from a Protected Worksheet

  1. #1
    Join Date
    Jun 2006
    Posts
    23

    How to insert row and copy formula from a Protected Worksheet

    I have a worksheet with locked columns containing formulas. how can i insert rows & copy the formula above without having to unprotect the worksheet.

  2. #2
    Join Date
    Jul 2010
    Posts
    93

    Re: How to insert row and copy formula from a Protected Worksheet

    In some versions of excel, you can allow the user to insert rows or columns when you protect the sheet. Make sure that all the rows/columns in that allowed range are unlocked.

  3. #3
    Join Date
    Apr 2010
    Posts
    80

    Re: How to insert row and copy formula from a Protected Worksheet

    But I need to have locked cells stay that way to prevent other users from changing the formulas and data in those cells. i tried recording a macro but I can't bypass unprotected the sheet. by the way, I'm using excel 2007.

  4. #4
    Join Date
    Jul 2010
    Posts
    142

    Re: How to insert row and copy formula from a Protected Worksheet

    You could add some code to your macro:
    activesheet.unprotect password:="topsecret"
    'your code here
    activesheet.protect password:="topsecret"

  5. #5
    Join Date
    Apr 2010
    Posts
    94

    Re: How to insert row and copy formula from a Protected Worksheet

    If the objective is to manually insert rows into the document after protection from XL2002 (I think, and perhaps also from XL2000), it is possible to protect the sheet, leaving the possibility to insert rows (via the Insert menu), see the available options box at the manual protection of the sheet. In VBA, you can also do (in the launch of the workbook in the Workbook_Open event): ActiveSheet.Protect Password = 'password', AllowInsertingRows: = True Moreover, if the goal is to insert rows in VBA, you can use the method Unprotect / Protect (as indicated by Robert that I welcome the way), but you can also use the protection sheet by VBA always launch of the workbook:

    ActiveSheet.Protect Password = 'password', UserInterfaceOnly: = True. With this argument, the changes are authorized by VBA code (without having to unprotect) but not allowed to the user.

  6. #6
    Join Date
    Jul 2010
    Posts
    64

    Re: How to insert row and copy formula from a Protected Worksheet

    To insert lines is sufficient to check the lines to enter when the sheet protectors. To delete rows (Delete rows in protected sheet does not work), I use this macro to be inserted in a standard module:
    Code:
    Public Sub EliminaRige ()
          ActiveSheet.Unprotect Password: = "abc"
              Selection.Delete Shift: = xlUp
          ActiveSheet.Protect Password: = "abc"
      end Sub

Similar Threads

  1. Replies: 1
    Last Post: 13-01-2012, 05:09 PM
  2. Getting a error saying invalid formula in Excel Worksheet
    By Thedevotee in forum Windows Software
    Replies: 3
    Last Post: 11-01-2012, 06:03 PM
  3. Replies: 3
    Last Post: 31-12-2011, 05:21 PM
  4. Replies: 4
    Last Post: 01-04-2011, 02:00 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
  •  
Page generated in 1,714,213,518.67711 seconds with 17 queries