VBA – Turn Formula Bar Off (or On)


When creating an Excel template you may want to turn off the formula bar to limit unwanted user actions.

Alternatively, if you are using a spreadsheet and the formula bar is missing you may want to turn it back on.

Turn Formula Bar On or Off From Excel

To toggle the formula bar On or Off:

On the Ribbon:
1. Click View
2. Check or Uncheck “Formula Bar” in the Show section
or you can use keyboard shortcuts: Alt > W > V > F

Formula Bar Toggle

Turn Formula Bar On or Off with VBA

To do this from VBA:

AutoMacro - VBA Code Generator

Macro to turn off the formula bar

Sub OffFormulaBar()
    Application.DisplayFormulaBar = False
End Sub

Macro to turn on the formula bar

Sub OnFormulaBar()
    Application.DisplayFormulaBar = True
End Sub

Expand or Collapse Formula Bar

You can also resize the Formula Bar by clicking and dragging at the bottom of the formula bar or by using this shortcut: CTRL + SHIFT + U (MAC: ^ + Shift + U).

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

alt text

Learn More!


<<Return to VBA Examples

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)