Flash Cards for my 1st grader

B

Barry

Hope you folks can direct me.

My first grade daughter enjoys math and could benefit from repeated flash
card work.
Right now she's studying Addition and subtraction with numbers 0-12

I've made up a couple of flash card spread sheets in Excel 2003 using data
validation list to keep her within her number groups with dropdowns.
But wife says that a plain popup flash card would provide a better learning
experience for her. I think I understand her there...LOL

Here is what I have:


A | B | C
------------ |----------------|--------------------------
1 | 0-12 |
------------ |----------------|--------------------------
2 +/- | 0-12 | Try Again / Good Job
------------ |----------------|--------------------------
3 | Answer input | Answer calculation for comparison
-12 - 24

Cell B1 & B2 have Data Validation List Dropdown Numbers 0-12 (Cells here are
unlocked)
Cell A2 Has Data Validation Dropdown List of + or - (Cell is unlocked)
Cell B3 has Data Validation List Dropdown Numbers -12 -24 (Cell is unlocked)

In Cell 2C is the formula : =IF(B3=C3,"Good Job!","Sorry Try Again!")
Conditional formatting colors this cell with this: If B3=C3 Color is Green
If B3<>C3 Color is Red .(Cell is Locked)
In Cell C3 is the formula : =IF(A2="+",B1+B2,B1-B2) this cell has a
background and foreground color of white (Cell is locked.)

Here is what I'd like:

The numbers in B1 and B2 to Appear on their own, without user intervention.
The program should select them randomly (only 0 - 12).
Cell A2 could stay as is allowing the user to select either Addition or
Subtraction.
B3 could allow input typed in but should accept only numbers (including the
minus sign) -12 through 24 in this case.


I think this is all you get the drift. Any help would be great.



Barry
 
B

Bernie Deitrick

Barry,

Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the
window that appears.

Anytime that cell B3 is selected, new numbers will appear in B1 and B2. If your daughter hits enter
when entering her guess, the selection should move to B4, and when she moves back to B3, the numbers
will update.

To restrict the entries to -12 to 24, select B3 then use Data / Validation and under Allow, select
"Whole numbers" then choose "Between", and set the mininum to -12 and the max to 24.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> "$B$3" Then Exit Sub

Application.EnableEvents = False

Range("B1").Value = Round(13 * Rnd() - 0.49, 0)
Range("B2").Value = Round(13 * Rnd() - 0.49, 0)

Application.EnableEvents = True


End Sub
 
S

ShaneDevenshire

Hi,

Something will need to trigger the picking of the number in B1 and B2 for
example pressing F9 or some shortcut key. The function you could use to
generate a number is =RANDBETWEEN(0,12) or whatever. This is an analysis
toolpak function so you need to choose Tools, Add-ins, and check Analysis
ToolPak.

You can control B3 with data validation, whole Numbers, between -12 and 24.

Now the problem lies in the fact that RANDBETWEEN recalculates everytime the
spreadsheet changes. It may be satisfactory to put Excel into Manual
recalculation mode but I suspect you will probably need VBA code.

Look at some of these ideas and see if they get you started.
 
B

Bernie Deitrick

Ooops, need to give her a chance to correct her mistakes (not that she'll make any, but some of her
friends might try... ;-) )

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> "$B$3" Then Exit Sub

Application.EnableEvents = False

If Range("C2").Value = "Good Job" Then
Range("B1").Value = Round(13 * Rnd() - 0.49, 0)
Range("B2").Value = Round(13 * Rnd() - 0.49, 0)
End If

Application.EnableEvents = True

End Sub
 
B

Barry

Bernie,

The following is a clip of the code as I pasted it into the VB Page Sheet
one.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> "$B$3" Then Exit Sub

Application.EnableEvents = False

If Range("C2").Value = "Good Job!" Then
Range("B1").Value = Round(13 * Rnd() - 0.49, 0)
Range("B2").Value = Round(13 * Rnd() - 0.49, 0)
End If

Application.EnableEvents = True

End Sub

Unfortunately for some reason it doesn't fire off.
Any comments welcome..

Thanks
Barry
 
B

Bernie Deitrick

Barry,

Temporarily change the code to this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Range("C2").Value = "Good Job!" Then
MsgBox "C2's value should make the code work."
Else
MsgBox "C2's value should keep the code from working."
End If

If Target.Address <> "$B$3" Then Exit Sub

Application.EnableEvents = False

If Range("C2").Value = "Good Job!" Then
Range("B1").Value = Round(13 * Rnd() - 0.49, 0)
Range("B2").Value = Round(13 * Rnd() - 0.49, 0)
End If

Application.EnableEvents = True

End Sub

That will flash a msgbox showing the results of the comparison.

IF no messge box appears, your code is in the wrong place, you don't have
events enabled, or macros are disabled.

HTH,
Bernie
MS Excel MVP
 
B

Barry

Bernie,



I gues I'm just about as thick as they get I just can't find the problem.

Is there a place I can post my file for someone to get and look at?

This should be so simple.



By the way my macros were enabled.

And I have no idea how to enable or disable events.



Barry,

_________________________________________________________________________

Temporarily change the code to this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Range("C2").Value = "Good Job!" Then

MsgBox "C2's value should make the code work."

Else

MsgBox "C2's value should keep the code from working."

End If

If Target.Address <> "$B$3" Then

Exit Sub

Application.EnableEvents = False

If Range("C2").Value = "Good Job!" Then

Range("B1").Value = Round(13 * Rnd() - 0.49, 0)

Range("B2").Value = Round(13 * Rnd() - 0.49, 0)

End If

Application.EnableEvents = True

End Sub

That will flash a msgbox showing the results of the comparison.



IF no messge box appears, your code is in the wrong place, you don't have
events enabled, or macros are disabled.



HTH, Bernie MS Excel MVP "Barry" <[email protected]
<
Bernie, The following is a clip of the code as I pasted it into the VB Page
Sheet one.



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address <> "$B$3" Then Exit Sub Application.EnableEvents = False
If Range("C2").Value = "Good Job!" Then Range("B1").Value = Round(13 *
Rnd() - 0.49, 0)

Range("B2").Value = Round(13 * Rnd() - 0.49, 0)

End If Application.EnableEvents = True End Sub Unfortunately for some reason
it doesn't fire off.

Any comments welcome..



<
Ooops, need to give her a chance to correct her mistakes (not that she'll
make any, but some of her friends might try... ;-) )



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address <> "$B$3" Then Exit Sub Application.EnableEvents = False
If Range("C2").Value = "Good Job" Then Range("B1").Value = Round(13 *
Rnd() - 0.49, 0)

Range("B2").Value = Round(13 * Rnd() - 0.49, 0)

End If Application.EnableEvents = True End Sub

-- HTH, Bernie MS Excel MVP "Bernie Deitrick" <deitbe @ consumer dot org>
wrote in message <
Barry, Copy the code below, right-click the sheet tab, select "View Code"
and paste the code into the window that appears.



Anytime that cell B3 is selected, new numbers will appear in B1 and B2. If
your daughter hits enter when entering her guess, the selection should move
to B4, and when she moves back to B3, the numbers will update.



To restrict the entries to -12 to 24, select B3 then use Data / Validation
and under Allow, select "Whole numbers" then choose "Between", and set the
mininum to -12 and the max to 24.



HTH, Bernie MS Excel MVP Private Sub Worksheet_SelectionChange(ByVal Target
As Range)

If Target.Address <> "$B$3" Then Exit Sub Application.EnableEvents = False
Range("B1").Value = Round(13 * Rnd() - 0.49, 0)

Range("B2").Value = Round(13 * Rnd() - 0.49, 0)



Application.EnableEvents = True End Sub "Barry" <[email protected]
<
Hope you folks can direct me.



My first grade daughter enjoys math and could benefit from repeated flash
card work.

Right now she's studying Addition and subtraction with numbers 0-12 I've
made up a couple of flash card spread sheets in Excel 2003 using data
validation list to keep her within her number groups with dropdowns.

But wife says that a plain popup flash card would provide a better learning
experience for her. I think I understand her there...LOL Here is what I
have:



A | B | C

------------ |----------------|--------------------------

1 | 0-12 |

------------ |----------------|--------------------------

2 +/- | 0-12 | Try Again / Good Job

------------ |----------------|--------------------------

3 | Answer input | Answer calculation for comparison

-12 - 24

Cell B1 & B2 have Data Validation List Dropdown Numbers 0-12 (Cells here are
unlocked)

Cell A2 Has Data Validation Dropdown List of + or - (Cell is unlocked)

Cell B3 has Data Validation List Dropdown Numbers -12 -24 (Cell is unlocked)



In Cell 2C is the formula : =IF(B3=C3,"Good Job!","Sorry Try Again!")
Conditional formatting colors this cell with this: If B3=C3 Color is Green
If B3<>C3 Color is Red .(Cell is Locked)

In Cell C3 is the formula : =IF(A2="+",B1+B2,B1-B2) this cell has a
background and foreground color of white (Cell is locked.)



Here is what I'd like:



The numbers in B1 and B2 to Appear on their own, without user intervention.
The program should select them randomly (only 0 - 12).

Cell A2 could stay as is allowing the user to select either Addition or
Subtraction.

B3 could allow input typed in but should accept only numbers (including the
minus sign) -12 through 24 in this case.



I think this is all you get the drift. Any help would be great.



Barry
 
B

Bernie Deitrick

Barry,

Is (e-mail address removed) your actual address? If so, I will send you an
email, to which you can reply and attach your file.

Bernie
 
B

Barry

yes

Bernie Deitrick said:
Barry,

Is (e-mail address removed) your actual address? If so, I will send you an
email, to which you can reply and attach your file.

Bernie
 
B

Bernie Deitrick

For folks following this thread, Barry had sheet protection turned-on, and
only allowed one cell to be selected. Theat meant that the selection change
event would not fire. I changed the sheet by taking off protection, added
some code to make the play a little easier, and it seems to work fine.

Bernie
 

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