I was making tests to find a solution to protect "unprotected" cells in a protected sheet against format, validation etc. changes. and I have found several problems. I would appreciate some help to do that, but I'd like to share first the most extrange problem I've found:
When I move one of the unprotected cell over another, apart from losing format, validation, etc, the major problem is that the protection itself is lost !!
For example, having a sheet protected except B7 and B10, if I move B7 over B10 from an editor account (not the owner), the protection in B7 is lost! while the protection in B10 is maintained.
Going back to the owner account I Check the protected exceptions and seem to be the originals, but if I reload the sheet I can see they are changed, and the exception in B7 has changed to a new range B10:A9 (yes, written in such order).
If I don't validate this protection, cell A9 remains protected in the editor account, but if I validate the protection from the owner account without changing, I can see that the range B10:A9 changes to the normal order A9:B10 and then from the editor account I can access to cells A9 to B10.
Is this a known thing? Am I doing something bad?
Edited: link to a demo sheet with edition access to anyone with the link:
https://docs.google.com/spreadsheets/d/1FzAMms7Wy93Nk-MOoxaRQzHSJZpbpWmcgB5FPUH_sjQ/edit?usp=sharing
Related
I am trying to code a Google sheet for my mother's book keeping but I am hitting a wall. I have a number of categories that will be referenced and, depending on the category the monetary value will be changing.
Example.
Clerical $20/hr
Prop Mngt $35/hr
Admin $50/hr
Plus others I'm not aware of yet
I have tried this code =IF(SEARCH("Administration",$C8)>0,"$50") and it worked for the one keyword.
When I tried =IF(SEARCH("Administration",$C8)>0,"$50"),=IF(SEARCH("Clerical",$C8)>0,"$20") I was given ERROR.
How do I tell C8 to autofill D8 with the correct hourly rate? This will then feed D10 with =SUM(D8*E8) ???
Thank you for your help. I know just enough to know it's possible but not enough to grasp the issues I'm facing.
Try
=IF(not(iserror(SEARCH("Administration",$C8))),"$50",IF(not(iserror(SEARCH("Clerical",$C8))),"$20",""))
Another solution is to use this formula I think more understandable
=IFs(not(iserror(SEARCH("Administration",A1))),"$50",not(iserror(SEARCH("Clerical",A1))),"$20")
I would like to know if it is possible to limit user access to certain tabs in a google sheet launched from the template gallery?
In our company, we have a sales department that uses an calculator builded on google sheet. In order to ensure that sellers always use the current version of the calculator (this is important because the parameters of the products change over time), I have placed its in google sheets template gallery and update it on a regular basis.
The problem is that one of the tabs in the sheet should not be available to sellers because it contains information about the prices of semi-finished products and materials, therefore there is a risk of their interference in these data and offering customers at lower prices (the product is very specific and prices are important even in scale 0.01 USD).
As you know, opening a new sheet from the template gallery makes the opener the owner of the file and thus he gets a full permissions to it. Therefore, setting sheet protection in the source file doesn't fix the problem.
Is there any solution how to handle with it? Thanks in advance.
You use 2 sheets
Rename your "Test - Calculator" to Calculator file (https://docs.google.com/spreadsheets/d/1HMYPA0W0gPS1A4hIo8_hWNcdhE7jQdyAKpv37Wk3m1I/edit?usp=sharing)
Permissions: Private (no sharing)
and rename "file 2" to Client input file (https://docs.google.com/spreadsheets/d/13vqFa2duep9Spc5AOEIvBUwdLr45VQOGy9EVwECiVEI/edit?usp=sharing)
Permissions: Public on the web (Any1 with the link can edit)
You first connect these files together because you will use IMPORTRANGE
For file Calculator file
You must have 2 tabs (the more tabs do whatever you want, keep, delete makes no difference)
Tab 1: solution for client
In 1st tab you have this formula only, in cell A1
=INDEX('aw7e%^y24#d9 strange tab name client can not guess'!A1:D22)
REMEMBER: ONLY from tab solution for client the client will see
Tab 2: aw7e%^y24#d9 strange tab name client can not guess
This tab only for calculations
cell C5: =IMPORTRANGE("13vqFa2duep9Spc5AOEIvBUwdLr45VQOGy9EVwECiVEI";"clientDATA!C3")
cell C6: =IMPORTRANGE("13vqFa2duep9Spc5AOEIvBUwdLr45VQOGy9EVwECiVEI";"clientDATA!C4")
cell C8: =IF(C5*C6=0;"";C5*C6)
cell C10: =IFS(C8="";"";C8<F3;E4;C8<G3;F4;C8<H3;G4;C8<=H3;H4;C8<=I3;I4;C8>I3;I4)
(I changed your formulas in cells C8 and C10 for better)
For file Client input file
You must have 1st tab clientDATA (the more tabs do whatever you want, keep, delete makes no difference)
Client puts input in cells C3 and C4
In cell C7 you put this formula:
=IMPORTRANGE("1HMYPA0W0gPS1A4hIo8_hWNcdhE7jQdyAKpv37Wk3m1I";"solution for client!C10")
You also protect the tab except cells C3 and C4 with Can edit (with warnings)
You finished.
Now when client put numbers in cells C3 and C4 they see results in C7
AGAIN REMEMBER: ONLY from tab solution for client the client will see
Is there a way to lock a formula to a range besides using protected ranges? I don't want the owner to be able to edit the formula. Essentially, it's a barcode generator and staff keeps deleting it. I have it in a protected range, however, the people who are deleting it are the owners. Any help is appreciated.
Scenario is simple: You as a teamleader managing team attendance in Google Sheet document. Every person should have the ability to edit rows that are only for him. So the person shouldn't be able to edit cells of colleague, but can still enter some data for himself.
Options that Google Sheet provide in the UI are restrictions to:
Protect whole sheet
Protect whole sheet with exception
Protect selected range on the sheet
All of those options provides ability to add/edit permission for this Restriction (this is not clear for first time usage). By setting the user himself in here actually cause:
Not apply restriction to him (so the user can still edit sheet)
User is able to edit restriction (this is kinda expected)
Question is if there is some way to prevent multiple users from entering multiple cells on same sheet, but he restriction will be applied per user?
Solution I'm looking for can be either from developer or classic user perspective.
I expected something like:
Lock whole sheet
Set permission for user A to edit range A1:B2
Set permission for user B to edit range B2:C3
I've visited How to protect ranges per specific users in google sheet? , but as stated above, it only adds editors, where the restriction is not applied to them.
When you lock the whole sheet, unfortunately it is not possible to unlock subranges of this sheet
The reason is that a locking of a sheet has a higher access priority than unlocking of a range.
As a consequence, you will need to use a workaround of splitting your sheet in different ranges and define different permissions for each range.
In your case:
Range 1: A1:A2 - only user A has access
Range 2: B1 - only user A has access
Range 3: B2 - user A and user B have access
Range 4: C2 - only user B has access
Range 5: B3:C3 - only user B has access
The rest of the sheet also needs to be split up in ranges, from which ALL editors need to be removed.
Obviously splitting up of ranges like this is very tedious, however what helps to automatise the process a bit, is using RangeLists.
I can recomend you use the RangeListApp library developped by #Tanaike.
UPDATE
There is a method called setUnprotectedRanges(ranges) which can overwrite the sheet protection.
Sample:
var protection = sheet.protect().setDescription('Sample protected sheet');
var unprotected = sheet.getRange('B2:C5');
protection.setUnprotectedRanges([unprotected]);
Mind that this method lifts the protection entirely, so you would still need to set a separate protection for the given range to make sure that only 1 user can edit this range.
I am creating an Expense Reimbursement spreasheet that will allow users to input their expenditures and the spreadsheet will automatically add all of the columns. I have protected the spreadsheet so that they can only enter information in unprotected cells. The problem I am having is: how do I protect the sheet so that when someone prints the form, they cannot change the print layout? (i.e. they should not be able to change the page layout, or change the margins, etc.) How can I protect the spreadsheet from someone printing it on legal paper, or putting it on 2 pages, etc?
There is, far as I can tell, no way to lock the layout... But how are you with VBA?
The Worksheets("SheetName").PageSetup object will allow you to specify all of the page setup properties, and if you were to put these specifications in the Workbook's Workbook_BeforePrint and Workbook_BeforeSave subroutines, Excel would 'reset' your specifications right before it printed (and saved), ensuring that your layout was honoured.