Je saisie de l'information dans un textbox. C'est un nombre d'itération à faire. Cependant, il semble que l'information que j'ai saisie est toujours sous une forme de texte. Comment on fait pour la transformer en valeur. Voici ma programmation. Merci pour votre aide à l'avance
Private Sub CommandButton1_Click()
If OptBtn1.Value = True Then
CopySem
ElseIf OptBtn2.Value = True Then
CopyMois
End If
End Sub
Sub CopySem()
Selection.Copy
y = 0
Do Until y = x
ActiveCell.Offset(0, 2).Select
ActiveSheet.Paste
y = y + 1
Loop
End Sub
Sub CopyMois()
Selection.Copy
y = 0
Do Until y = x
ActiveCell.Offset(0, 3).Select
ActiveSheet.Paste
y = y + 1
Loop
End Sub
Private Sub TxtBox1_AfterUpdate()
x = Format(TxtBox1.Value, 0)
End Sub
Private Sub CommandButton1_Click()
If OptBtn1.Value = True Then
CopySem
ElseIf OptBtn2.Value = True Then
CopyMois
End If
End Sub
Sub CopySem()
Selection.Copy
y = 0
Do Until y = x
ActiveCell.Offset(0, 2).Select
ActiveSheet.Paste
y = y + 1
Loop
End Sub
Sub CopyMois()
Selection.Copy
y = 0
Do Until y = x
ActiveCell.Offset(0, 3).Select
ActiveSheet.Paste
y = y + 1
Loop
End Sub
Private Sub TxtBox1_AfterUpdate()
x = Format(TxtBox1.Value, 0)
End Sub