Don't display formula


Posted by Colin on January 14, 2002 10:40 PM


Is there a way when the active cell is displayed, it won't show the formula in it. Or perhaps if there are 5 rows of formula in one cell which will cause the formula box to enlarge to five rows down maybe only showing one row of the formula.



Posted by Steve on January 15, 2002 2:15 AM

You can hide the formula bar easily enough. Tools/options/view, then uncheck the Show Formula Bar box.

To do it automatically for a particular file, you want the following in ThisWorkbook.

Open your file. Press Alt F11 to open the vba editor. On the left you will see a window with "VBA Project(Yourfilename.xls) in it. There may be a list of the worksheets and ThisWorkbook under it. If not, click the + next to your project, then expand Microsoft Excel Objects the same way.

Now double-click ThisWorkbook and copy the following into the main window:

Private Sub Workbook_Open()
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFormulaBar = False
End Sub

Alt F11 to return to your spreadsheets, then save your work.