Hide Formula Bar on Selected Sheets

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
Dear All

I have been using the following code to turn on and off the Formula Bar when a specific workbook containing one sheet is opened and closed.

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

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


However, I now have a need to turn it off for this one particular sheet but turned back on for other new sheets in the same workbook. Can this be achieved?


As always many thanks for any help you can provide.

Lapta301
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If it is only for one particular sheet in the workbook - right-click the sheet's tab and select View Code. You can use the sheet's Activate and Deactivate events.

Hope this helps,

Mark
 
Upvote 0
GTO

Thank you, it works a treat other than one minor issue.

If the file was saved with, in this case the sheet "HowTo" active where the formula bar should be hidden then it reopens on that sheet with the formula bar visible. That will change when you activate another sheet so how do I ensure that the workbook opens on the sheet "Stats" regardless of what was active at the time of saving.

Sorry if I'm rambling but I hope this makes sense.

Many thanks for taking the time to help me.


lapta301
 
Upvote 0
GTO

Not to worry I have found the answer to this minor issue elsewhere.

Again my sincere thanks for taking the time to answer my initial problem

Regards



Lapata301
 
Upvote 0

Forum statistics

Threads
1,206,755
Messages
6,074,756
Members
446,083
Latest member
kfunt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top