+ Reply to Thread
Results 1 to 29 of 29

Edit protected sheets via master sheet

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Edit protected sheets via master sheet

    Hi all,
    I am struggling a little with protection on linked sheets on a single workbook. I have a master sheet which is linked to two additional sheets, which generate marked up values from the master.
    I need to be able to protect the two linked sheets, so that they cannot be worked on, but at the same time allow for inserting and deleting rows via the master sheet.

    Is this at all possible?
    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Welcome to the forum

    Yes, this can be done via VBA.
    The code to protect and unprotect a sheet named "Apple" is below

    When you are in sheet "Master" when do you want to insert/delete rows in the other sheets?
    - user says I want to insert some rows?
    - driven by values in sheet Master?
    - which rows are to be "inserted"
    etc

    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Hi Kev,
    Thanks for the reply.
    The sheet is being used as a basic template for schedule of works. Basically I have a master sheet (with 2 linked sheets) set up which has allowed 4 rows for each work type (there are 10 work types). Each schedule is bespoke and may require more or less than 4 lines per work type. What I need to be able to do is insert or delete the rows accordingly whilst keeping the 2 linked sheets locked.

    Does that make sense?

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    3 questions
    Q1 How do we select the rows to be copied?
    (eg could user select them with mouse and then run a macro? is it all the completed in rows in the data area? etc)

    Q2 Does the data require deleting after its been copied to other sheet(s)?

    Q3 Where is it copied to?
    (eg bottom of ranges in the 2 additional sheets, somewhere else?)


    It would also help if you attach a workbook (make it anonymous) - click on Reply, then Go Advanced then Manage Attachments etc

    ManageAttachments3.jpg

  5. #5
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    1) on the master sheet, whilst holding Ctrl I select the 3 tabs (sheets). Then using the mouse select and copy a full row and insert directly below the copied row. (this only works when the 2 linked tabs are not protected)

    2) The data will stay on the master sheet and 2 linked sheets

    How do I make my upload anonymous?

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    I meant make the data anonymous - no personal names or anything organisationally sensitive - so amend text values to Client001 rather than actual client name etc

    Don't forget to give us the password for the 2 sheets
    Last edited by kev_; 04-03-2017 at 08:44 AM.

  7. #7
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Hi Kev,
    No passwords on the 2 sheets yet they are currently unprotected.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Thanks for the workbook.
    Are you copying and pasting one row at a time?

    Can you just list all your steps for me replacing the question marks with sheet names and column letters etc
    (I may be able to automate a bit more for you - you should not need to select all the tabs etc)

    1 enter values in columns ? ? ? in sheet named "?"
    2 select the an entire row (or columns A:D ???) to copy
    3 select the 3 sheets named "?" "? " and "?" (using their tabs)
    4 select the next available row in the appropriate section
    5 paste values? or values and formula??? - all 3 sheets are updated together
    6 Which sheets will contain passwords?

    thanks

  9. #9
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Kev,

    As an example, say I am filling out the numerous floor works required. (Section 3.00)

    Say for arguments sake there are 5 types of flooring required for this job

    Stone
    Tiles
    Carpet
    Safety floor
    Wood

    On the Net Cost Sheet, in column B Row 14, I type in the description of the first type i.e Stone floor and continue across the row adding to Column C D & E (Qty, unit and rate) this then populates the total and also the marked up cells in tabs "Cost & Client".

    I then do the same for the other floor types directly below each other, Rows
    15, 16 & 17. As there is a fifth finish required I would need to insert another row directly below,in this case on row 18.

    Normally I would hold Ctlr, select there 3 tabs to group them (Net Costs, Cost & Client), highlight the row I want to copy (Row 17) and insert copy cells in the next row (Row 18) thus moving all the other cells down.

    This then replicates the inserted cells on the linked tabs.

    It unfortunately does not work when the 2 lined sheets (Cost & Client) are protected.


    1 enter values in columns Row 14 Columns C,D & E in sheet named Net Cost
    2 select the 3 sheets named "Net Costs" "Cost " Client "?" (using their tabs)
    3 select the an entire row (Row 14) to copy
    4 select the next available row in the appropriate section (Row 17)
    5 Insert Copied Cells - all 3 sheets are updated together
    6 Which sheets will contain passwords - Cost & Client


    I think this makes sense

    Regards

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    See if this gives you what you want

    Select any cell in the row that you want to copy and run the macro with {CTRL} t
    It copies and inserts in the same row. So make sure you insert the last row in the section if that is where you want the new row inserted.

    The 2 sheets "Cost" and "Client" are currently password protected with password = "password"

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Hi Kev,
    Thank you for sorting this, it seems to be working great.
    How difficult would it be to set up a similar function that inserts complete items, such a 4.00 Walls? So it would insert the Title Row, 4 Rows and a the total Row. Say rows 23-29.

    This would allow me to insert additional works without having to do it manually across the 3 sheets.

  12. #12
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Let's chat about how you want it to work

    Amend this to what you want to happen

    1. Go to row where I want to add a new block of 6 rows

    2. Trigger macro that asks me what I want to insert from a dropdown
    SELECT FROM:
    3.00 Floors
    4.00 Walls
    5.00 Ceilings
    6.00 Wall Finishes
    7.00 Elevations
    7.01 Elevation AA
    7.02 Elevation BB etc...

    3. Based on selection

    - 6 rows inserted:
    = Category row (no formula)
    = 4 X data rows (see formulas below)
    = Total row (=SUM formula for the 4 data rows)

    - in 3 sheets - formulas as per example (row 10) in data rows:

    Column F sheet"Net Costs"
    =C14*E14

    Columns C:F sheet "Cost"
    = 'Net Costs'!C10
    = 'Net Costs'!D10
    = 'Net Costs'!D10*1.25
    = C10*E10

    Columns C:F sheet "Client"
    = 'Net Costs'!C10
    = 'Net Costs'!D10
    = VALUE(Cost!E10)
    = C10*E10

  13. #13
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    We should not really need all the options from the drop down as they are all the same ant it will be renamed for the new work.

    1. Go to row where I want to add a new block of 7 rows

    2. Trigger macro that inserts the following

    - 7 rows inserted:
    = Category row (no formula)
    = 4 X data rows (see formulas below)
    = Total row (=SUM formula for the 4 data rows)
    = Blank space row (no formula as existing)

    - in 3 sheets - formulas as per example (row 10) in data rows:

    Column F sheet"Net Costs"
    =C14*E14

    Columns C:F sheet "Cost"
    = 'Net Costs'!C10
    = 'Net Costs'!D10
    = 'Net Costs'!D10*1.25
    = C10*E10

    Columns C:F sheet "Client"
    = 'Net Costs'!C10
    = 'Net Costs'!D10
    = VALUE(Cost!E10)
    = C10*E10

    How does that sound

  14. #14
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    We should not really need all the options from the drop down
    - does this mean you require no options?
    - if so the category row is blank and you have to type in standard wording in 3 sheets
    - with the selection cell in column A and in column B can be populated automatically

  15. #15
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    The category row will need a heading but will be a new description example 11.00 plumbing works.
    is it possible to replicate 3.00 Floors and then I can amend the category and figure to suit?

  16. #16
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    The easiest way to achieve this would be to have the 7 row X 3 sheet "standard" block available somewhere so that it is a simple copy and Insert/paste job
    - all the formula will correctly re-reference cells and also it will make modification easy for you later if something fundamental changes

    So - where do we put the 7 rows - my choice would be:
    - the first 7 rows of the 3 sheets
    - make the rows not visible

    It's either that
    - or somewhere below the data (and hide the rows)
    - or create a separate sheet for this purpose with 21 lines (7 per sheet) - I have not tested this - but I think it will re-reference everything correctly

    Which do you prefer?

  17. #17
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    I am thinking below the data line so that it cannot interfere with any calculations.

  18. #18
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    This worked for me

    What you need to do

    - copy blocks of 7 model rows in 3 sheets
    - paste to identical 7 rows in each sheet (below the data)
    (I used Joinery & Metalwork as my 7 rows to copy and paste)
    - amend the defaults for category and number (in sheet "Net Costs" , column A and B)

    - create Named Ranges for each of the 3 areas
    - I used Model1, Model2 and Model3 for "Net Costs", "Cost" and "Client" areas respectively
    - use your own names but amend the Select Case bit of the VBA to match

    - put this VBA in a general module, and allocate a short-cut to it, making it easy to run
    Please Login or Register  to view this content.
    NamedRangeForProj.jpg

  19. #19
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    I attach the test file just in case you need to look at anything
    VBA in post18 runs with {CTRL} k

    (and the insert single row VBA runs with {CTRL} t )

  20. #20
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Hi Kev
    Thank you for this it works a treat. Only one problem i have is that I had a go at creating my own Macro last night for deleting a line out, which was working but now has stopped any ideas why?



    Please Login or Register  to view this content.
    Last edited by 123987; 04-04-2017 at 11:51 AM.

  21. #21
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Please edit your previous post - select the VBA and then click on # icon
    thanks

  22. #22
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Is that right?

  23. #23
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Yes and your code works for me - it deletes a row in 3 sheets as expected

    Are your macros disabled?
    2 obvious things to try:
    - is VBA in debug mode needing a reset? (see picture)
    - close the file and re-open it

    ResetVBA.jpg

  24. #24
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    It seems to work on the sheet I used last night, but not on sheet you created today with the 7 row macro.
    I'm a little bit lost

  25. #25
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Are you using different passwords?
    - that would also prevent your macro from working

  26. #26
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    No it was the same password. I have tried this morning and it seems to be working OK thank you. Am I right in assuming that the total in cell F 192 reverts to #VALUE! as a result of the macro adding / removing rows? do I just need to refresh this sum manually?

  27. #27
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    Error in F192
    I do not know when the error occurred on line 192. When testing lots of things get changed.
    Fix it and hopefully it will not recur.

    Unfortunately some formulas do not like rows being deleted etc
    Usually that error manifests itself with #REF error - that is because a "key" cell has been deleted and the formula cannot use it

    Keep this in mind, in case you need it later:
    - Named Ranges can be single cells or a range of cells
    - avoid the dreaded #REF by using named ranges instead of cell references in formula (unless you delete the entire range!!)
    - eg name each of your subtotal cells "TotalPrelims", "TotalDemolition" etc and then arrive at the grand total with
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (or you can use =SUM)
    - when a new category is inserted, create a new range name for its subtotal and amend the formula for grand total

    Overall total logic check
    It may be useful for you to have a logic check at the bottom of the sheet to give you confidence that your grand total is correct.
    With your grand total in cell F198, this formula should equate to zero:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    04-03-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    16

    Re: Edit protected sheets via master sheet

    Hi Kev,
    Thank you for all your help on this, all seems to working perfect. I will be sure to give you a shout If I am ever stuck again.
    Thanks again

  29. #29
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Edit protected sheets via master sheet

    You are welcome

    Please mark thread as solved (Thread Tools @ top of thread)

+ 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] Master sheet to split sheets back to another master sheet
    By FurRelKT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2017, 02:08 PM
  2. replicating a column from master sheet to other sheets and sorting on the master sheet
    By kstormy1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2016, 07:57 PM
  3. Master sheet that can transfer/edit information in other sheets
    By mwinn004mwinn004 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2016, 09:49 PM
  4. Trying to edit a master timesheet to spread across all other sheets in work book.
    By dark91zc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2013, 02:02 PM
  5. Allow user to edit ranges on a protected sheet
    By aleenkhan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2012, 04:46 PM
  6. Protected Sheet Allow Edit Objects
    By jonhfl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2011, 10:38 AM
  7. Replies: 1
    Last Post: 03-29-2006, 03:35 PM

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