how to disable formula bar?

R

Ric

I have produced a quiz worksheet - all the answers are below the input
cells - in an 'if' statement.

I have used protection to hide them, only allowing input in the appropriate
cells...

But the user can still select; View - formula bar, and thereby see the
formulae containing the answers - how can I stop this?

Thanks

Ric
 
D

Dave Peterson

You can lock the cells with the formulas
(format|cells|protection tab, but check locked and Hidden)

And unlock all the cells that should allow user input.

Then tools|protection|protect sheet
give it a nice password
and your formulas will be hidden.

That said, worksheet protection is very weak. There's code posted here every
day/week that would unprotect the worksheet.
 
J

J.E. McGimpsey

One way:

Put this in your ThisWorkbook code module (right-click on the
worksheet title bar and choose View Code):

Option Explicit
Dim bFBVisState As Boolean

Private Sub Workbook_Activate()
With Application.CommandBars("Formula Bar")
bFBVisState = .Visible
.Visible = False
.Enabled = False
End With
End Sub

Private Sub Workbook_Deactivate()
With Application.CommandBars("Formula Bar")
.Visible = bFBVisState
.Enabled = True
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top