Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding the formula bar in Excel for a specific file

Tags:

excel

I would like to hide the formula bar in a specific Excel file and only in this file. I know we can do it with VBA (Application.DisplayFormulaBar = False) but I am wondering if there is another solution like editing the CustomUI file.

Usually I edit the CustomUI file for hiding ribbon, adding custom tabs, ... It would be nice if we can hide the formula bar in this way.

Any suggestions?

Thanks.

like image 421
Bronzato Avatar asked Nov 22 '11 09:11

Bronzato


People also ask

How do you hide formulas in Excel without protecting sheet?

If you're wondering whether you can hide the formulas in Excel without protecting the sheet, unfortunately, you can't. As of now, the only way to hide the formulas in Excel is to protect the sheet and also make sure that the hidden properties enabled for the cells that have the formula.


1 Answers

I know it's a 2011 issue, but the solutions shown above don't seem to be the right ones for the problem in question.

If you modify using vba Aplication.whatelse this change applies to the entire excel app

To fix this instead of turning on/off when you open/close the document uses the sheet's activate/deactivate events

This way when your hidden document is turned on and when you turn off swatches.

This works perfect for me, to hide status bar and formula bar.

I leave you code to see how it works

Private Sub Workbook_Activate()
    Application.DisplayStatusBar = False
    Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_Deactivate()
    Application.DisplayStatusBar = True
    Application.DisplayFormulaBar = True
End Sub
like image 107
Javier Martin Gil Avatar answered Oct 05 '22 01:10

Javier Martin Gil