Tenho um VBA no Excel, entretanto o comando salva os lançamentos como texto, então não é possível aplicar qualquer fórmula. Já fiz algumas tentativas e pesquisa mas todas foram fracassadas, segue os códigos:
Private Sub CommandButton_gravar_Click()
Dim valor As Currency
Dim data As Date
valor = TextBox_valor
data = TextBox_data
Range("b11").Select
If Range("b12").Value <> "" Then
Selection.End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
Selection.Value = TextBox_data
ActiveCell.Offset(0, 1).Select
Selection.Value = ComboBox_categoria
ActiveCell.Offset(0, 1).Select
Selection.Value = TextBox_historico
ActiveCell.Offset(0, 1).Select
Selection.Value = ComboBox_movimento
ActiveCell.Offset(0, 1).Select
Selection.Value = TextBox_valor
Unload UserForm_lançamento
Também tentei fazer um teste após o lançamento para converter em numero mas não funcionou
For Each cell In [f1:f50000]
If cell > "" Then
numero = (cell.Value)
cell.Activate
ActiveCell.FormulaR1C1 = numero
Else
End If
Next
Minha última tentativa foi tentar converter o seguinte código
Selection.Value = TextBox_valor
Selection.NumberFormat = "$#,##0.00"