Al halar de un formulario un valor inferior a $1.000.000 lo muestra incompleto

Private Sub Precio_Change()

'Condicionar Formato Moneda en Textbox del Formulario

With Me.Precio
.Value = Precio.Value
.Value = Format(.Value, "$#,###,###")
End With

End Sub

Private Sub Ingresarbtn_Click()

Dim m As Variant
Sheets("Cotizacion").Select

m = 14

Do While (Cells(m, 2) <> Empty Or Cells(m, 4) <> Empty Or Cells(m, 5) <> Empty)

m = m + 1

Loop

Sheets("Cotizacion").Select

If Referencia.Text = Empty Then

MsgBox "La Casilla Referencia es Obligatoria"

ElseIf Cantidad.Value <> Empty Then

Cells(m, 2).Value = Formulario_Cotizar.Referencia.Value
Cells(m, 3).Value = Formulario_Cotizar.Producto.Text
Cells(m, 4).Value = Formulario_Cotizar.Marca.Value
Cells(m, 5).Value = Formulario_Cotizar.Cantidad.Value
Cells(m, 6).Value = Formulario_Cotizar.Precio.Value

Else
MsgBox "Ingrese una Cantidad del producto que desea cotizar"

Cantidad.SetFocus
End If

If Cantidad.Value <> Empty Then

Referencia = Empty
Producto = Empty
Marca = Empty
Cantidad = Empty
Precio = Empty
Existencias = Empty
Ubicacion = Empty
ComboBox1 = Empty
ComboBox1.SetFocus

End If

End Sub

1 respuesta

Respuesta
1

Prueba cambiando el valor del textbox Precio con la función CDbl( )

Me permití hacerle algunos ajustes a tu macro:

Private Sub Ingresarbtn_Click()
'
    Dim m, h, wprecio
    Set h = Sheets("Cotizacion")
    m = 14
    Do While h.Cells(m, 2) <> ""
        m = m + 1
    Loop
    '
    If Referencia.Text = Empty Then
        MsgBox "La Casilla Referencia es Obligatoria"
        Referencia.SetFocus
        Exit Sub
    End If
    '
    If Cantidad.Value = Empty Then
        MsgBox "Ingrese una Cantidad del producto que desea cotizar"
        Cantidad.SetFocus
        Exit Sub
    End If
    '
    h.Cells(m, 2).Value = Formulario_Cotizar.Referencia.Value
    h.Cells(m, 3).Value = Formulario_Cotizar.Producto.Text
    h.Cells(m, 4).Value = Formulario_Cotizar.Marca.Value
    h.Cells(m, 5).Value = Formulario_Cotizar.Cantidad.Value
    If IsNumeric(Formulario_Cotizar.Precio.Value) And _
       Formulario_Cotizar.Precio.Value <> "" Then
        wprecio = CDbl(Formulario_Cotizar.Precio.Value)
    Else
        wprecio = Formulario_Cotizar.Precio.Value
    End If
    h.Cells(m, 6).Value = wprecio
    '
    Referencia = Empty
    Producto = Empty
    Marca = Empty
    Cantidad = Empty
    Precio = Empty
    Existencias = Empty
    Ubicacion = Empty
    ComboBox1 = Empty
    ComboBox1.SetFocus
End Sub

Prueba y me comentas


.

'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

.

Avísame cualquier duda

.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas