
If PosizioneXCrescente.Text <> "" Then
countit = PosizioneXCrescente.Text
If PosizioneXCrescente.Text > 0 Then ''SE il valore di X>=0 allora decresci fino a zero
Do While countit > 0
countit = countit - 1
SpinButtonPerMovimentazionAsseX.Value = countit
Loop
ElseIf PosizioneXCrescente.Text < 0 Then
Do While countit < 0
countit = countit + 1
SpinButtonPerMovimentazionAsseX.Value = countit
Loop
Else
MsgBox "arrivati a 0"
End If ''altrimenti SE il valore di X<0 allora cresci fino a zero
SpinButtonPerMovimentazionAsseX.Value = countit
PosizioneXCrescente.Text = countit
End If
|
Sub prova()
Dim i As Integer
For i = 1 To 20
Range("a1").Value = i
Application.Wait (Now + TimeValue("0:00:01"))
Next i
End Sub
Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 20
Userform1.TextBox1.Value = i
Application.Wait (Now + TimeValue("0:00:01"))
Next i
End Sub
|
codice hellboy
For i = 1 To 20
Userform1.TextBox1.Value = i
Application.Wait (Now + TimeValue("0:00:01"))
Next i
Codice di alfrimpa
Do While countit < 0
countit = countit + 1
SpinButtonPerMovimentazionAsseX.Value = countit
Loop
Come vedi anche io avevo pensato a questo ciclo. |
