lonlyboy
New Member
- Joined
- Feb 16, 2010
- Messages
- 25
- Office Version
- 365
- Platform
- Windows
I thought this seemed easy.
First; I'm running Win XP using Excel 2007.
I'm creating a very simple excel sheet to help my son learn to count.
I have 2 buttons, one labeled "add" and one "sub".
My son is learning his numbers from 1-31 right now.
I have the following for "add" and similiar for "sub".
bascially what I want to do is when my son gets to 31 and hits "add" again I want excel to notice the next number is 32 and reset cell A1 to "0".
Also looking for the reverse. If my son hits "sub" and goes below "0" it keeps reseting to "0". That way my son only sees numbers 0-31.
I've tried this under the worksheet:
Excel does nothing with this code.
Any thoughts would be helpful.
LB
First; I'm running Win XP using Excel 2007.
I'm creating a very simple excel sheet to help my son learn to count.
I have 2 buttons, one labeled "add" and one "sub".
My son is learning his numbers from 1-31 right now.
I have the following for "add" and similiar for "sub".
Code:
Sub Addition()
Range("A1").Value = Range("A1").Value + 1
End Sub
bascially what I want to do is when my son gets to 31 and hits "add" again I want excel to notice the next number is 32 and reset cell A1 to "0".
Also looking for the reverse. If my son hits "sub" and goes below "0" it keeps reseting to "0". That way my son only sees numbers 0-31.
I've tried this under the worksheet:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "A1" And Range("A1").Value = -1 Then Run "Zero"
If Target.Address = "A1" And Range("A1").Value = 32 Then Run "Zero"
End Sub
Excel does nothing with this code.
Any thoughts would be helpful.
LB