-
Mar 4th, 2021, 11:07 AM
#1
Thread Starter
Lively Member
[RESOLVED] Select case Need help
Hello
Code:
Private Sub Text1_Change()
Case 40
Text2.Text = 1
Case 41
Text.Text = 2
Text 42
Text2.Text = 3
.
.
.
Case 60
Text2.Text = 20
End Select
I want like this:
Code:
Private Sub Text1_Change()
Select Case Text1.Text
Case 40 To 60
Dim i
For i = 1 To 20
Text2.Text = 1 + i
Next i
End Select
End Sub
but this not working
Any help please
Last edited by Adebiyi24; Mar 4th, 2021 at 12:07 PM.
-
Mar 4th, 2021, 11:56 AM
#2
Hyperactive Member
Re: Select case Need help
You want to get numbers from 10 to 20 in Text2 ?
-
Mar 4th, 2021, 11:57 AM
#3
Re: Select case Need help
Explain what final result you are after (instead of what would you do).
-
Mar 4th, 2021, 12:06 PM
#4
Thread Starter
Lively Member
Re: Select case Need help
Originally Posted by Argus19
You want to get numbers from 10 to 20 in Text2 ?
yes sir
I mean each time a number go up (increment) in textbox 1 ( 40 , 41, 42 ......60) same thing happens in textbox 2 ( 1, 2, 3, ......20)
when I put 45 in textbox 1 , textbox 2 display 5
-
Mar 4th, 2021, 12:11 PM
#5
Hyperactive Member
Re: Select case Need help
Code:
Private Sub Text1_Change()
Text2.Text = ""
Select Case Text1.Text
Case 40 To 60
Text2.Text = Val(Text1.Text) - 40
End Select
End Sub
-
Mar 4th, 2021, 12:37 PM
#6
Thread Starter
Lively Member
Re: Select case Need help
-
Mar 4th, 2021, 12:42 PM
#7
Hyperactive Member
Re: Select case Need help
This will be more correct:
Code:
Private Sub Text1_Change()
Text2.Text = ""
Select Case Val(Text1.Text)
Case 40 To 60
Text2.Text = Val(Text1.Text) - 40
End Select
End Sub
-
Mar 4th, 2021, 12:53 PM
#8
Thread Starter
Lively Member
Re: Select case Need help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|