I'm using a textbox to get some numbers. I seems that i'm getting trought that TextBox field are text and not numbers. How can i transform the data in a number. Down below is the code that i'm using. Can someone help me please. Thanks.
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
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