J
jasonsweeney
I need a user interface that does the following:
Click on cell A1 once and it produces a "1" in cell B1
Click on cell A1 a second time, and it products a "2" in cell B1
Click on cell A1 a third time, and it produces a "3" in cell B1
Click on cell A1 a fourth time, and it produces a "4" in cell B1
*** Click on cell A1 a fifth time, and it resets the cell to "". an
the process can be repeated.
Thus, a person can cycle through the numbers 1-4 in cell B1 by simpl
clicking on cell A1 four times....I think I have to select a differen
cell after each cycle so the person has to click BACK on cell A1 t
trigger....thus the last code line will select a different cell tha
the A1 cell.
Below is the code I have so far, but it does not work. It cycle
through the 4 numbers instantly without stopping. Thus I need t
arrest the cycle after each mouse “click”. Any help would be greatl
appreciated.
[In cells B1:B12 I entered the months of the year]
_____________________________________
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A12")) Is Nothing Then
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1).Value = 1
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 1 Then
Target.Offset(0, 1).Value = 2
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 2 Then
Target.Offset(0, 1).Value = 3
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 3 Then
Target.Offset(0, 1).Value = 4
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 4 Then
Target.Offset(0, 1).Value = ""
Target.Offset(0, 2).Select
End If
End If
End If
End If
End If
End If
End Sub
*** Extra help...this code also produces an error if the user tries t
select more than one cell at a time...
Click on cell A1 once and it produces a "1" in cell B1
Click on cell A1 a second time, and it products a "2" in cell B1
Click on cell A1 a third time, and it produces a "3" in cell B1
Click on cell A1 a fourth time, and it produces a "4" in cell B1
*** Click on cell A1 a fifth time, and it resets the cell to "". an
the process can be repeated.
Thus, a person can cycle through the numbers 1-4 in cell B1 by simpl
clicking on cell A1 four times....I think I have to select a differen
cell after each cycle so the person has to click BACK on cell A1 t
trigger....thus the last code line will select a different cell tha
the A1 cell.
Below is the code I have so far, but it does not work. It cycle
through the 4 numbers instantly without stopping. Thus I need t
arrest the cycle after each mouse “click”. Any help would be greatl
appreciated.
[In cells B1:B12 I entered the months of the year]
_____________________________________
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A12")) Is Nothing Then
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1).Value = 1
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 1 Then
Target.Offset(0, 1).Value = 2
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 2 Then
Target.Offset(0, 1).Value = 3
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 3 Then
Target.Offset(0, 1).Value = 4
Target.Offset(0, 2).Select
If Target.Offset(0, 1) = 4 Then
Target.Offset(0, 1).Value = ""
Target.Offset(0, 2).Select
End If
End If
End If
End If
End If
End If
End Sub
*** Extra help...this code also produces an error if the user tries t
select more than one cell at a time...