Hide formulas in formula bar

Folks,
I know I can hide the formula bar but here's my objective.
I am trying to teach my youngest son more about Excel. There is a section of tabs that are for exercises that need to be solved. If he gets the incorrect answer then his formula or function is incorrect and he get some message like "Try again - wrong results"
I'm considered conditional formatting but also looking for an alternative solution.
Frank FreeseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Not exactly what you asked for but here's a little UDF that will show a formula in a cell.

Function GetFormula(cel As Range) As String
GetFormula = cel.Formula
End Function

Open in new window

0
Frank FreeseAuthor Commented:
Martin,
I've got that already but thanks.
0
mvidasCommented:
Hi fh,

On a cell you want the formula hidden, go to the Format Cells window (control 1 or right-click/Format Cells or Home/Cells/Format/Format Cells). On the Protection tab are checkboxes for Locked and Hidden.  When the worksheet is Protected, "Hidden" hides the formula, and "Locked" makes the cell unable to be changed.

To protect your sheet, go to the Home tab, the Cells group, the Format button, then Protect Sheet. Choose a password (or don't), and press OK. The cells you chose to hide formulas now display nothing in the formula bar.

Matt
0
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Frank FreeseAuthor Commented:
Matt,
However, outside of hiding the formula bar, is there away to keep a formula from displaying in the formul bar....
0
mvidasCommented:
fh,

Yes, exactly as I described above. You need to check the protection "hidden" checkbox for every cell you want to hide the formula, then protect the sheet.

Matt
0
Frank FreeseAuthor Commented:
For example, if A1 = 1 and B1 = 3 then sum in C1 = 4. However, if the sum is anything other than 4, I would like the user to know that their formula is incorrect. Conditional formatting could get me there, but I was looking for some thing different. In other word, error checking the results on a cell
0
Martin LissOlder than dirtCommented:
You can add code to Worksheet_Change event but that only fires after the user leaves the cell so you would need a "Check Answer" button or something.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mvidasCommented:
Ok, that is doable using data validation. I must ask though, what do you need to hide from the formula bar then? I assumed (using your example above), that in D1 you had something like
=IF(LEN(C1)=0,"Please enter sum of A1 and B1",IF(C1=4,"You got it!","Sorry, please try again"))
And you wanted to hide formula in D1 so your son couldn't see the "if c1=4" part.

Data validation could also do what you want. Try the following example showing both methods, which is preferred for you?

EDIT: The sheet is protected, without a password
fh-sample.xlsx
0
Frank FreeseAuthor Commented:
I'm going to go with another command bar that will check the answer
Thanks folks - great ideas
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.