armazenar textbox como numero , valor e data

CLAUDIO SANTOS

31-08-2015 11:40:58

bom dia
tenho este código mas sempre armazena somente a data como data
o restante como texto você pode me ajudar por favor

Private Sub CommandButton1_Click()

Dim numero As Double
Dim VALOR As Currency
Dim DATA As Date

numero = TextBox1
VALOR = TextBox2
DATA = TextBox3

Plan1.Range("A10000").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select


ActiveCell = TextBox1
ActiveCell.Offset(0, 1).Select

ActiveCell = TextBox2
ActiveCell.Offset(0, 1).Select


ActiveCell = TextBox3
ActiveCell.Offset(0, 1).Select




End Sub

Reinaldo

31-08-2015 12:04:41

Como já definiu variáveis do tipo esperado/desejado, experimentou utiliza-las??

Código: Selecionar todos

Private Sub CommandButton1_Click()
Dim numero As Double
Dim VALOR As Currency
Dim DATA As Date

numero = TextBox1
VALOR = TextBox2
DATA = TextBox3

Plan1.Range("A10000").Select
Selection.End(xlUp).Select

ActiveCell.Offset(1, 0).Select
ActiveCell = numero

ActiveCell.Offset(0, 1).Select
ActiveCell = VALOR

ActiveCell.Offset(0, 1).Select
ActiveCell = DATA

ActiveCell.Offset(0, 1).Select
End Sub
ou ainda

Código: Selecionar todos

Private Sub CommandButton1_Click()

Plan1.Range("A10000").Select
Selection.End(xlUp).Select

ActiveCell.Offset(1, 0).Select
ActiveCell = TextBox1*1

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox2*1

ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox3*1

ActiveCell.Offset(0, 1).Select
End Sub