Increase formula bar height in 1 sheet only, keeping other sheets as default

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

I have used this code to increase the height of the formula bar when the particular sheet 'Race Log' is activated and which works fine.
VBA Code:
Private Sub Worksheet_Activate()
Application.FormulaBarHeight = 2
End Sub
However, when I open any of the other 15 sheets in the workbook after this sheet, the height remains increased and the only way I know to reduce it is to use similar code in all the other sheets
VBA Code:
Private Sub Worksheet_Activate()
Application.FormulaBarHeight = 1
End Sub
Is there a better way to do this?

Thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi, have you tried or considered the Worksheet_Deactivate() event of the "Race Log" sheet to reset the formuka bar height
 
Upvote 0
No I hadn't, thank you! Can you tell me how I would use that please?
 
Upvote 0
Hi, exactly like your activate events - but only needed in the "Race Log" sheets code module.

VBA Code:
Private Sub Worksheet_Deactivate()
Application.FormulaBarHeight = 1
End Sub
 
Upvote 0
Solution
Thanks but when would the deactivate event occur?

Sorry, that seems a silly question but does Excel deactivate the sheet when I select another sheet? Else how does Excel know when to deactivate it? I need the bar height increased while the sheet is active.
 
Upvote 0
Well I don't understand how it works but it works - many thanks!
 
Upvote 0
Thanks, that's interesting as I'd always assumed that happened anyway (I thought only the sheet you were working on was the 'active' sheet, which made the others 'inactive').
 
Upvote 0

Forum statistics

Threads
1,213,514
Messages
6,114,078
Members
448,547
Latest member
arndtea

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