Hide Formulas that are currently visible. How?

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi All:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I have a bunch of spreadsheet s that I want to modify as quickly as possible. Currently when the user open the file the Formula Bar gets hidden via:<o:p></o:p>
<o:p></o:p>
Code:
[COLOR=black][FONT=Verdana]Private Sub Workbook_Open()[/FONT][/COLOR]
[FONT=Verdana][COLOR=black]Application.DisplayFormulaBar = False[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]End Sub[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]Private Sub Workbook_BeforeClose(Cancel As Boolean)[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]Application.DisplayFormulaBar = True[/COLOR][/FONT]
[FONT=Verdana][COLOR=black]End Sub[/COLOR][/FONT]
<o:p></o:p>
<o:p></o:p>
I was hiding the formulas because some are quite long and they were blocking the sheet when the cell containing the long formula was selected. Unfortunately I was not aware that I could simply check of Hidden in the Protection properties. <o:p></o:p>
<o:p></o:p>
QUESTION: Is there a way that I can select all the cells on a worksheet (or workbook if doable) that contain a formula and then implement <o:p></o:p>
<o:p></o:p>
Code:
[COLOR=black][FONT=Verdana]Selection.FormulaHidden = True<o:p></o:p>[/FONT][/COLOR]
<o:p></o:p>
<o:p></o:p>
I don't want to have to manually select the cells if I can avoid it. I searched the forum but my search brought up too many results that were not applicable. If someone has a suggestion or can point me towards a similar post that would be GREAT.<o:p></o:p>
<o:p></o:p>
Bye 4 Now,<o:p></o:p>
Mark :biggrin:
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi Mark. Maybe

Code:
ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormulas).FormulaHidden = True
 
Upvote 0
Try something like this...
Code:
Dim ws as Worksheet
For Each ws in Worksheets
    ws.Cells.FormulaHidden = True
Next ws
 
Upvote 0
THANKS Peter, THANKS AlphaFrog. :biggrin:

I will try your codes out. I might have to go with Peters code because after thinking about it there might be a couple of sheets where the formulas should be visible. They are hidden sheets but when unhidden the formulas may have to be visible...

ANYWAY, THANKS again for your suggestions.

Have a GREAT day ALL,
Mark :biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

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