Learning Excel #1, Designing Math Challenge For Young Children, Template #1

Standard

Hello all,

It is a long time since I have written something and I kind of miss writing and while I am waiting for some brilliant idea for some short story, I decided to create a little section on my blog where I will be writing about my progress on learning new Excel skills.

One of the reasons why I am doing that is my obsession with documentation of what I do and also, to have some platform where I can get some feedback from more knowledgeable folks. Because I’m only a beginner in visual basic and it takes me a while to get appropriate advice from forums. Plus, apparently, journaling is good method of feeling good about one’s life.

That should be enough for brief introduction.

Now let me present you my first work. A simple math template that I have created for my daughter.

1, The idea
The idea is pretty simple. Although to execute it took me quite a while. But I learned a lot during the process.

The template is based on 10 simple equations, each of which has got a reference cell to show whether the answer is correct, or not. The correct answer gets a green smiley face and an incorrect answer gets a red frown face.
On top of that, if all 10 answers are correct, a nice picture is displayed as a “reward”.

2, How does it work?
~ Checking the answers
Each answer is checked through the conditional formatting. If the answer is correct, the cell with answer is filled with green, if not the fill is red. Next to each cell with answer is another cell into which a smiley, or frown face is pulled from a hidden referencing column. In those cells, again, conditional formatting is used to give the cell matching filling, again, either green, or red.

~ Checking whether all answers are correct
This is achieved by calculating the difference between the answer provided by user and between the correct answer checked by Excel itself. If the difference is 0, the answer is correct.
Then the SUM of all differences is pulled into the master cell, which again, if all differences are 0, means all answers are correct, and in case its value is different than 0, at least one answer is incorrect, in which case the reward picture won’t be displayed.

~ Commands/Macros
I decided to execute the checks by user. It was suggested to me, that I could have had an automated check run as soon as the last answer is provided, which I have to admit, was a relevant suggestion. I however wanted my daughter to get used to using a mouse and check it herself. I also wanted her to be able to restart the challenge manually. So there are two macro enabled buttons to execute this. One that checks the answers, and one that restarts the task.

~ Coding
Here’s the full code for the challenge:

Sub Check_Answers()

‘ Check_Answers Macro


Columns(“G:G”).Select
Selection.EntireColumn.Hidden = False
Range(“E14”).Select
If (Range(“L12”).Value = 0) Then

Columns(“K:K”).Select
Selection.EntireColumn.Hidden = False
Range(“E14”).Select

End If

End Sub
Sub Start_Again()

‘ Start_Again Macro


Range(“F2:F11”).Select
Selection.ClearContents
Columns(“G:G”).Select
Selection.EntireColumn.Hidden = True
Columns(“K:K”).Select
Selection.EntireColumn.Hidden = True
Range(“F2”).Select
End Sub

~ Pictures to give idea

image

image

image

image

image

image

~ Possible improvements

1, Automated macro to check all the answers and display the final result as soon as the last answer is provided

2, Randomization of the equations automatically as soon as the file is open

~

So this is my first post about my learning using VBA and designing in Excel. If you have any comments, or suggestions please let me know in comments.
Please remember that I am not an expert, but I hope that at some point in future, I will be. I couldn’t imagine Excel being fun, but surprisingly it is.

Download:
Full Excel file can be downloaded from here >>>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s