I want to achieve the following:
- I do not want other users of the sheet to access the formula bar for certain cells/sheets of the spreadsheet
This is not possible. You could publish your spreadsheet but this will not allow to edit any content, or to use Google Forms, but this will allow respondents only to submit data, not to view the result of calculations.
To securely hide the formulas they should be in another spreadsheet. You could use IMPORTRANGE or a script to import/export the calculations result. Bear in mind that IMPORTRANGE isn't recalculated immediately and that scripts could be slower than built-in functions.
An alternative is to create a web app that makes the calculations and call it from a custom function.
- I want to block them from accessing the script editor (do not want to show the code) used for this sheet
It's not possible to block editors to access the Script editor. For details see Scripts Bound to Google Sheets, Docs, or Forms. To prevent that viewers get access to the code, block the spreadsheet for making a copy. For details see Change your sharing settings
You can set permissions per cell:
- Click the cell - Left-mouse click or Ctrl+click -> menu 'Protect range' - Click 'Set Permissions' in sidebar - Select Only You
Now the content is still visible. There is a work-around for this, which is quite complicated.
- Create another sheet, called Formulas. - Protect this sheet the same way above. - In your main sheet you can refer to formulas in the other sheet: =Formulas!B1 - Now you can write the formula in this cell B1 in sheet Formulas =Sheet1!B1+Sheet1!C1-Sheet1!D1 (where Sheet1 is the name of the first sheet) - Now hide the Formulas sheet