Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
UB UB is offline
external usenet poster
 
Posts: 120
Default Formula Bar Hidden

Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Formula Bar Hidden

Try deleting the If statement and just use:

Application.DisplayFormulaBar = True

No error is generated if the Formula Bar is already displayed.


"ub" wrote in message
...
Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem



  #3   Report Post  
Posted to microsoft.public.excel.programming
UB UB is offline
external usenet poster
 
Posts: 120
Default Formula Bar Hidden

Hi
Thanks for the reply

I tried with removing the if statement and it still does not work.

Please advise


"JLGWhiz" wrote:

Try deleting the If statement and just use:

Application.DisplayFormulaBar = True

No error is generated if the Formula Bar is already displayed.


"ub" wrote in message
...
Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Formula Bar Hidden

After thought. You will also need to save the workbook after you re-instate
the Formula Bar, otherwise it will open in the last saved state.


"ub" wrote in message
...
Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem



  #5   Report Post  
Posted to microsoft.public.excel.programming
UB UB is offline
external usenet poster
 
Posts: 120
Default Formula Bar Hidden

I added code
activeworkbook.save
after the Application.DisplayFormulaBar = True statement.
But it still does not work.

Please advise, if I need to change the save statement

"JLGWhiz" wrote:

After thought. You will also need to save the workbook after you re-instate
the Formula Bar, otherwise it will open in the last saved state.


"ub" wrote in message
...
Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Formula Bar Hidden

Works for me.

Could be done with a few less lines.

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

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


Gord Dibben MS Excel MVP

On Thu, 8 Oct 2009 07:18:01 -0700, ub wrote:

Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem


  #7   Report Post  
Posted to microsoft.public.excel.programming
UB UB is offline
external usenet poster
 
Posts: 120
Default Formula Bar Hidden

Hi Gord

Thanks for the reply.

I have a an Exit button on one of the sheets that closes the workbook.
I put the code [application.DisplayFormulaBar = True ] in the code of this
exit button before the [activeworkbook.save ] and it works now.

Thanks to all


"Gord Dibben" wrote:

Works for me.

Could be done with a few less lines.

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

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


Gord Dibben MS Excel MVP

On Thu, 8 Oct 2009 07:18:01 -0700, ub wrote:

Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering Formula - Cannot select cell as it is hidden by formula Jim Excel Worksheet Functions 0 March 25th 10 07:22 AM
Hidden Formula Bar James Setting up and Configuration of Excel 4 July 10th 08 06:26 PM
Hidden Formula Bar Bonkers Excel Discussion (Misc queries) 1 June 16th 08 10:42 AM
Rows hidden by Autofilter vs hidden by changing the Hidden property LEO@KCC Excel Programming 4 September 11th 07 10:14 AM
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"