PeterBaileyUk
asked on
counter increment
I have a global counter that is increased from 0 to 50 by a plus and a minus button.
I would like the incrementation to scale so fom 0 to 5 or 5 to 0 in steps of 1 and from 5 to 50 in steps of 5 or -5 if decreasing
my current code works but only in steps of 1 which is a lot of clicks
I tried a case with 0 to 4 with increments of 1
then 5 to 49 with increments of 5
but the counts go beyond 50 my upper limit so it all falls apart
I would like the incrementation to scale so fom 0 to 5 or 5 to 0 in steps of 1 and from 5 to 50 in steps of 5 or -5 if decreasing
my current code works but only in steps of 1 which is a lot of clicks
I tried a case with 0 to 4 with increments of 1
then 5 to 49 with increments of 5
but the counts go beyond 50 my upper limit so it all falls apart
Private Sub BtnVCCPlus_Click()
Select Case vCCCount
Case 0
vCCCount = vCCCount + 1
Case 1 To 49
vCCCount = vCCCount + 1
Case 50
End Select
LblVCCCount.Caption = vCCCount
End Sub
Private Sub BtnVCCMinus_Click()
Select Case vCCCount
Case 0
Case 1 To 49
vCCCount = vCCCount - 1
Case 50
vCCCount = vCCCount - 1
End Select
LblVCCCount.Caption = vCCCount
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
just couldnt get my head around that one thank you
ASKER
Open in new window