Kindergarten Math

My wife and I split duties when it comes to teaching our kindergarten-age son. She teaches him reading and writing and I teach him math. To that end, I created a table to help him memorize adding and multiplying zero through nine. It’s nothing fancy, but you can have it if you like.

Download MathGames.zip

I started with a grid and some formatting. I use Row 1 and Column A to hold random numbers so I can sort Row 2 and Column B. The data entry grid is conditionally formatted to show green for correct answers and red for incorrect.

conditional formatting dialog

The formula for the first one is

=IF($H$13=1,AND(NOT(ISBLANK(C3)),C3=C$2+$B3),AND(NOT(ISBLANK(C3)),C3=C$2*$B3))

The second formula is the same except for it’s ‘not equal’ instead of ‘equal’.

user interface with selected data shown

The Start Over button just resets everything with a simple macro:

Sub Reset()
   
    Dim rTop As Range
    Dim rSide As Range
    Dim rData As Range
   
    Set rTop = Sheet1.Range(“TopRow”)
    Set rSide = Sheet1.Range(“SideCol”)
    Set rData = Sheet1.Range(“Data”)
   
    rData.Parent.Unprotect
    rData.ClearContents
    rTop.Sort rTop.Cells(1), , , , , , , xlNo, , , xlSortRows
    rSide.Sort rSide.Cells(1), , , , , , , xlNo, , , xlSortColumns
    rData.Parent.Protect
   
    rData(1).Select
   
End Sub

I need to put some fancy animation in for when all the cells are green. So that there’s a prize for completing it.

Posted in Uncategorized

12 thoughts on “Kindergarten Math

  1. how can i see the code to the controls? I checked the VBE and there’s no code for the controls…

    sorry if i sound like a n00b

  2. Simon: The controls are from the Forms toolbar. If you right click on the buttona and choose Assign Macro, you’ll see the macro that’s run when you click it. There is no code for the option buttons. They are linked to cell H13, which is used in the conditional formatting formula. Right click on one of them and choose Format Control to see this.

  3. thanks a lot! i see it now… didn’t realize you could manipulate Controls without VB code.

  4. DK:

    Either I need to return to Kindergarten (do not comment) or the Evalution Version tab should not read “Multiplication”–because I started out with many red cells.

    DA

  5. Just curious what “mulitplcation” is? Sounds like some kind of hockey hairdo process.

  6. This appears to be yet another ingenious DK invention so that he can sit and soak up useless information on TV (and a few gin & tonics) whilst his protege soaks up knowledge

  7. Thanks, this is cool. My child is 8 and he still will have fun with this. Anything on the computer is more fun than having to pick up an old fashioned pencil! It might also be a great way for me to improve my skills. I want to add a subtraction and divide function. I am a beginner though and donít understand the language yet. What do the following anachronisms mean? Alternatively where can I find a good reference list of anachronisms?
    VBE
    n00b
    VB

  8. Ann,

    I think you meant “malaprop.” Just kidding.

    Anyways:
    VB is Visual Basic – a standalone programming language which can create .exe files.
    VBA (even though you didn’t ask) is Visual Basic for Applications which has much the same syntax as VB but must be run “inside” Excel, Word, or another program, and is the language used in the above example. It cannot be used to create .exe files – it can only run inside … oops, already said that.
    VBE is the Visual Basic Editor, the interface wherein VBA code is written. To get to it press Alt-F11 while in Excel.


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.