+ Reply to Thread
Results 1 to 8 of 8

Insert rows in a protected sheet

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Insert rows in a protected sheet

    hi there,

    Please help.
    I have a shared workbook which has various users at the same time but I want to protect the information in some of the lines.
    I want the user to be able to insert new rows anywhere in the workbook and add information.
    The one row is blank and the other row is a row to separate the rows from the other information.
    So the user need to insert two rows every time. One for information and one as a separater
    I know I need to use a macro but I dont know how to write it

    Thanks
    Aneshree

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Insert rows in a protected sheet

    You know you have the option to protect a sheet but still allow users to insert rows, right?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows in a protected sheet

    yes this I know. I want to lock rows where the users dont have acess

  4. #4
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows in a protected sheet

    sorry. Tell me how.

  5. #5
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows in a protected sheet

    I tried this but when I insert a row, it inserts the lock row which I dont want.
    My file has one locked row and next unlocked. The file only allows inserting of lock rows

  6. #6
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows in a protected sheet

    Row test.xlsm
    I have attached an exmaple.
    The grey rows (4,6,8,9,10,12,14) are locked ans should remain the same size.
    It is a shared file therefore normally about 8 users are using at the same time.
    People should be abled to add two rows (eg 10 & 11). This should be able to be done any where on the sheet.
    Row 10 is locked and row 11 unlocked for the person to write in here.

    Please help with this

    Thanks

  7. #7
    Registered User
    Join Date
    04-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Insert rows in a protected sheet

    hello,

    I found this but I am still miss inserting 2 rows with one row being a blocked row and one an unblocked row.

    Sub test()
    Dim y As Long
    Dim x As Long
    Application.ScreenUpdating = False
    y = InputBox("How many rows")
    x = Selection.Rows.Count
    ActiveCell.Offset(x).Select
    Do Until x = 0
    Range(ActiveCell, ActiveCell.Offset(y - 1)).EntireRow.Insert
    x = x - 1
    ActiveCell.Offset(-1).Select
    Loop
    Application.ScreenUpdating = True
    End Sub


    http://www.excelforum.com/excel-prog...-new-post.html

    This is were I found the above program. Thanks John

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Insert rows in a protected sheet

    Aneshree,
    If I'm following your process, you want to insert two rows, one locked, to be used as a seperator, and one unlocked, to allow the user to enter information. So, for your range of rows after inserting, the pattern should be a row or rows of data, following by an empty row, followed by row or rows of data, followed by an empty row, etc. When your user inserts multiple rows by using the macro above, the pattern changes; now you have row or rows of data, following by an empty row, followed by row or rows of data, followed by an empty row AND an extra empty row. You want to unlock that extra empty row, right? You could put a formula to check for a collection of two empty rows following one another , filter for whichever row of those two you want unlocked, and unlock that one.

+ 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] Insert cut row in protected range of rows
    By a_27826 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-27-2014, 04:49 PM
  2. Copy and paste insert rows with protected cells in protected worksheet
    By excel_gecko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2012, 05:50 PM
  3. [SOLVED] Code to cut and paste rows (insert cut cells) in a protected Excel sheet
    By bob.mc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2012, 04:47 PM
  4. Delete rows in a protected sheet with protected cells
    By Maranwe in forum Excel General
    Replies: 7
    Last Post: 10-31-2011, 08:12 AM
  5. Excel 2007 : Insert Row to a Protected Sheet
    By Justinetme in forum Excel General
    Replies: 1
    Last Post: 08-31-2009, 12:51 PM

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