¿Textbox No suma Decimales?

Hla, tengo un formulario con 4 textbox alineados en dos columnas de dos textbox c/u y un botón entre ellos, o que hace mi formulario es esto:
Escribo un Valor en el Textbox1, presiono el botón que esta entre los dos textbox, el botón busca ese valor en una base de datos, al encontrarlo, desde la celda activa brinca 6 columnas y develve el valor de esa celda en el textbo2 (éste se encuentra deshabilitado, es solo lectura) y hace lo mismo con el textbox3 y textbox4... Después tengo otro botón y otro textbox(5) al dar click a este botón presenta la suma de los textbox2 y textbox4
... Ya investigue y supe que tengo que convertir los valores a números (val(textbox))
Mi problema es que no toma en cuenta los decimales, es como si no existieran, no los suma, ni siquiera los presenta, por ejm
Textbox2 = 1000,15 + textbox4 = 100,10
El resultado debería ser 1100,25
Pero el textbox solo presenta 1100 sin decimales
Ya intente poner formato así
IMPTOT.Value = Format(Val(IMPTOT.Value), formato)
IMPTOT.Value = Format(Val(IMPTOT.Value) + CDbl(IMPTOT.Value), formato)
no funcionó, intenté así y tampoco suma los decimales, ni los presenta
formato = "#" & Application.International(xlDecimalSeparator) & "00"
IMPTOT.Value = Format(Val(IMPTOT.Value), formato)
Ya intenté cambiando la configuración regional para que el signo decimal sea "," y no "." pero de ninguna dorma lo hace! ¿Alguien puede ayudarme por favor?
Estoy desesperado, tengo 2 días intentándolo y no he podido lograrlo, me urge por favor alguien que se apiade de mi :S

3 Respuestas

Respuesta
1
En primer lugar tu configuración regional debiera tener el formato de tu país, en todos los aspectos y en especial 'moneda'.
Además revisa que no tengas repetidos los caracteres utilizados: coma, pto y coma, signo menos, etc.
Esto no es solo para Excel, sino para un buen desempeño en general.
Ahora a tu consulta: la instrucción debiera ser:
Textbox5.value = cdbl(textbox2)+cdbl(textbox4)
Luego para pasarlo a la hoja también utilizá nuevamente la función cdbl
Saludos
Elsa
** Todas las funciones de conversión en manual 400MacrosPlus y Userforms.
http://es.geocities.com/lacibelesdepunilla/manuales
Hola, gracias por responder, tenias razón en cuanto a la configuración regiona, ya la chque y modifique, ya presenta y suma los decimales, pero lo hice con la función Val, ya que intente con la función Cdbl como tu me dices pero no funciona, me dice que no coinciden los Tipos, no se porque, bueno, el caso es que, no se que le habré movido pero ahora los números que escriba yo, en cualquier archivo de excel, me los trunca muy raro, por ejm, escribo 1100 y me lo presenta como 11.00, ya revise la configuración regional y me parece que esta correcto, estoy en Mexico, signo de Decimales ".", separador de miles ",", No. de Decimales "2" (Pensé que sería por esto pero lo cambie a "0" y seguía igual, así que lo deje en "2"), moneda "$"... había puesto esta linea también IMPTOT = Format(IMPTOT, "#,##0.00;-#,##0.00"), pero lo quite y sigue truncando los números, ¿por qué sera?
Saludos y gracias por la ayuda
Parece que modificaste las opciones desde el menú Herramientas, Opciones, donde en 1 pestaña encontrarás una opción de 'Insertar automáticamente un pto decimal ', que debés destildar.
Si no lo encontrás en tu versión escribime que la busco, porque estoy con la 2007.
Hola, pues ya se arregló lo de que "truncaba" los números, no sé exactamente a que se debió pero ya, ahora, ya pude hacer que el Textbox donde presenta el total de la suma de los demás Textbox ya lo presenta con separador de miles y suma decimales, pero los demás textbox no ponen separador de miles, mira este es mi código haber si puedes detectar mi error por favor.
Dim H1, H2, H3, H4, H5, H6, H7, H8, H9, H10 As String
Dim D1, D2, D3, D4, D5, D6, D7, D8, D9, D10 As String
Private Sub CommandButton2_Click()
If Not (Fact1) = "" Then
Fa1 = Val(Fact1.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact1.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa1, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D1 = ActiveCell.Offset(0, 7).Address
ubi1 = D1
H1 = ActiveSheet.Name
HOJA1 = H1
IMP1 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact2.SetFocus
Fact2 = Empty
REF2 = REF1
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton3_Click()
If Not (Fact2) = "" Then
Fa2 = Val(Fact2.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact2.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa2, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D2 = ActiveCell.Offset(0, 7).Address
ubi2 = D2
H2 = ActiveSheet.Name
HOJA2 = H2
IMP2 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
REF3 = REF2
Fact3.SetFocus
Fact3 = Empty
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton4_Click()
Dim Fa3 As Integer
If Not (Fact3) = "" Then
Fa3 = Val(Fact3.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact3.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa3, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D3 = ActiveCell.Offset(0, 7).Address
ubi3 = D3
H3 = ActiveSheet.Name
HOJA3 = H3
IMP3 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
REF4 = REF3
Fact4.SetFocus
Fact4 = Empty
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton5_Click()
Dim Fa4 As Integer
If Not (Fact4) = "" Then
Fa4 = Val(Fact4.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact4.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa4, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D4 = ActiveCell.Offset(0, 7).Address
ubi4 = D4
H4 = ActiveSheet.Name
HOJA4 = H4
IMP4 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
REF5 = REF4
Fact5.SetFocus
Fact5 = Empty
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton6_Click()
Dim Fa5 As Integer
If Not (Fact5) = "" Then
Fa5 = Val(Fact5.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact5.SetFocus
Exit Sub
End If
'On Error GoTo Pendientes
Cells.Find(What:=Fa5, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D5 = ActiveCell.Offset(0, 7).Address
ubi5 = D5
H5 = ActiveSheet.Name
HOJA5 = H5
IMP5 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact6.SetFocus
Fact6 = Empty
REF6 = REF5
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton8_Click()
Dim Fa6 As Integer
If Not (Fact6) = "" Then
Fa6 = Fact6.Value
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact6.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa6, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D6 = ActiveCell.Offset(0, 7).Address
ubi6 = D6
H6 = ActiveSheet.Name
HOJA6 = H6
IMP6 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact7.SetFocus
Fact7 = Empty
REF7 = REF6
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton9_Click()
Dim Fa7 As Integer
If Not (Fact7) = "" Then
Fa7 = Val(Fact7.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact7.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa7, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D7 = ActiveCell.Offset(0, 7).Address
ubi7 = D7
H7 = ActiveSheet.Name
HOJA7 = H7
IMP7 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact8.SetFocus
Fact8 = Empty
REF8 = REF7
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton10_Click()
Dim Fa8 As Integer
If Not (Fact8) = "" Then
Fa8 = Val(Fact8.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact8.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa8, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D8 = ActiveCell.Offset(0, 7).Address
ubi8 = D8
H8 = ActiveSheet.Name
HOJA8 = H8
IMP8 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact9.SetFocus
Fact9 = Empty
REF9 = REF8
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton11_Click()
Dim Fa9 As Integer
If Not (Fact9) = "" Then
Fa9 = Val(Fact9.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact9.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa9, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D9 = ActiveCell.Offset(0, 7).Address
ubi9 = D9
H9 = ActiveSheet.Name
HOJA9 = H9
IMP9 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Fact10.SetFocus
Fact10 = Empty
REF10 = REF9
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub CommandButton12_Click()
Dim Fa10 As Integer
If Not (Fact10) = "" Then
Fa10 = Val(Fact10.Value)
Else
MsgBox ("DEBE ESCRIBIR UN No. DE FACTURA PRIMERO")
Fact10.SetFocus
Exit Sub
End If
On Error GoTo Pendientes
Cells.Find(What:=Fa10, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
D10 = ActiveCell.Offset(0, 7).Address
ubi10 = D10
H10 = ActiveSheet.Name
HOJA10 = H10
IMP10 = ActiveCell.Offset(0, 6).Value
IMPTOT = Val(IMP1) + Val(IMP2) + Val(IMP3) + Val(IMP4) + Val(IMP5) + Val(IMP6) + Val(IMP7) + Val(IMP8) + Val(IMP9) + Val(IMP10)
IMPTOT = Format(IMPTOT, "#,##0.00")
Aplicar.SetFocus
Exit Sub
Pendientes:
Load UserForm2
UserForm2.Show
Exit Sub
End Sub
Private Sub Aplicar_Click()
If MsgBox("APLICAR DEPOSITOS?", vbYesNo) = vbYes Then
Application.ScreenUpdating = False
If (IMP1) > 0 Then
Sheets(H1).Select
Range(D1) = IMP1
Range(D1).Select
ActiveCell.Offset(0, 2).Value = Val(REF1)
IMP1 = Format(IMP1, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D1).Offset(0, 1).Value = Fecha
If Not (IMP2) = "" Then
Sheets(H2).Select
Range(D2) = IMP2
Range(D2).Select
ActiveCell.Offset(0, 2).Value = Val(REF2)
IMP2 = Format(IMP2, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D2).Offset(0, 1).Value = Fecha
If Not (IMP3) = "" Then
Sheets(H3).Select
Range(D3) = IMP3
Range(D3).Select
ActiveCell.Offset(0, 2).Value = Val(REF3)
IMP3 = Format(IMP3, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D3).Offset(0, 1).Value = Fecha
If Not (IMP4) = "" Then
Sheets(H4).Select
Range(D4) = IMP4
Range(D4).Select
ActiveCell.Offset(0, 2).Value = Val(REF4)
IMP4 = Format(IMP4, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D4).Offset(0, 1).Value = Fecha
If Not (IMP5) = "" Then
Sheets(H5).Select
Range(D5) = IMP5
Range(D5).Select
ActiveCell.Offset(0, 2).Value = Val(REF5)
IMP5 = Format(IMP5, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D5).Offset(0, 1).Value = Fecha
If Not (IMP6) = "" Then
Sheets(H6).Select
Range(D6) = IMP6
Range(D6).Select
ActiveCell.Offset(0, 2).Value = Val(REF6)
IMP6 = Format(IMP6, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D6).Offset(0, 1).Value = Fecha
If Not (IMP7) = "" Then
Sheets(H7).Select
Range(D7) = IMP7
Range(D7).Select
ActiveCell.Offset(0, 2).Value = Val(REF7)
IMP7 = Format(IMP7, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D7).Offset(0, 1).Value = Fecha
If Not (IMP8) = "" Then
Sheets(H8).Select
Range(D8) = IMP8
Range(D8).Select
ActiveCell.Offset(0, 2).Value = Val(REF8)
IMP8 = Format(IMP8, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D8).Offset(0, 1).Value = Fecha
If Not (IMP9) = "" Then
Sheets(H9).Select
Range(D9) = IMP9
Range(D9).Select
ActiveCell.Offset(0, 2).Value = Val(REF9)
IMP9 = Format(IMP9, "#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D9).Offset(0, 1).Value = Fecha
If Not (IMP10) = "" Then
Sheets(H10).Select
Range(D10) = IMP10
Range(D10).Select
ActiveCell.Offset(0, 2).Value = Val(REF10)
IMP10 = Format(IMP10, "#,#,##0.00")
ActiveCell = Val(ActiveCell)
Range(D10).Offset(0, 1).Value = Fecha
Else
Fecha.SetFocus
Exit Sub
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
REF1 = Val(REF1)
REF2 = Val(REF2)
REF3 = Val(REF3)
REF4 = Val(REF4)
REF5 = Val(REF5)
REF6 = Val(REF6)
REF7 = Val(REF7)
REF8 = Val(REF8)
REF9 = Val(REF9)
REF10 = Val(REF10)
Call INICIAR_Click
Application.ScreenUpdating = True
End Sub
Private Sub Fecha_AfterUpdate()
Fecha.Value = Format(Fecha, "D/MM")
End Sub
Private Sub CommandButton1_Click()
If MsgBox("Realmente deseas cerrar el Formulario???", vbYesNo) = vbYes Then
Unload UserForm1
Else
Aplicar.SetFocus
End If
End Sub
Private Sub GUARDAR_Click()
ThisWorkbook.Save
Call INICIAR_Click
End Sub
Private Sub INICIAR_Click()
REF1 = Empty
REF2 = Empty
REF3 = Empty
REF4 = Empty
REF5 = Empty
REF6 = Empty
REF7 = Empty
REF8 = Empty
REF9 = Empty
REF10 = Empty
IMP1 = Empty
IMP2 = Empty
IMP3 = Empty
IMP4 = Empty
IMP5 = Empty
IMP6 = Empty
IMP7 = Empty
IMP8 = Empty
IMP9 = Empty
IMP10 = Empty
HOJA1 = Empty
HOJA2 = Empty
HOJA3 = Empty
HOJA4 = Empty
HOJA5 = Empty
HOJA6 = Empty
HOJA7 = Empty
HOJA8 = Empty
HOJA9 = Empty
HOJA10 = Empty
ubi1 = Empty
ubi2 = Empty
ubi3 = Empty
ubi4 = Empty
ubi5 = Empty
ubi6 = Empty
ubi7 = Empty
ubi8 = Empty
ubi9 = Empty
ubi10 = Empty
Fact1 = Empty
Fact2 = Empty
Fact3 = Empty
Fact4 = Empty
Fact5 = Empty
Fact6 = Empty
Fact7 = Empty
Fact8 = Empty
Fact9 = Empty
Fact10 = Empty
IMPTOT = Empty
Fecha.SetFocus
Fecha = Empty
End Sub
Supongo que puede simplificarse pero aun estoy aprendiendo, creo que con un Select Case podria evitar tantos IF pero aun no se bien como usarlo. El Userform2 lo que hace es cambiar de hoja si no se encuentra el valor, busque como hacer para que Find busque en Todas las hojas del libro pero no encontré como hacerlo, por eso tuve que hacerlo con un userform, y también busque como guardar la ubicación así Hoja!"Celda" pero solo encontré la función Address que guarda la celda, y se me ocurrió guardar en otra variable el nombre de la hoja (H) así cuando necesito cambiar de hoja (Según el número encontrado) solo llamo a Sheets(H). select y listo.
Pero bueno, por ahora solo quisiera que los demás Textbox presenten los valores con separador de miles... Gracias
Comprenderás que me es imposible seguir una rutina de estas dimensiones... pero te recuerdo lo anterior de los formatos:
Si una celda tiene valores con decimales, tu instrucción siguiente debiera mostrártelos con decimales.
IMP1 = Activecell.offset(0,6).value  
Luego para la suma utiliza Cdbl en lugar de Val como te lo mencioné en un principio. Si ya arrglaste el tema de la configuración debiera andar bien. Cualquier dificultad solicítame un ejemplo a mi correo.
IMPTOT= cdbl(imp1)+cdbl(imp2) ........
Saludos
Elsa
** Solo el conocimiento nos hará libres ! ! 
http://es.geocities.com/lacibelesdepunilla/manuales
Bueno, ya cheque y nomas no encuentro porque no me presenta los otros textbox con separador de miles, de cualquier forma gracias, al menos el Textbox del total ya me lo presenta correcto.
Muchas Gracias por todo
Respuesta
1

Pues mira yo lo hice así y estos son los resultados, te pongo una imagen de la macro que use

Respuesta

Al sumar siempre me redondeaba 5,5 me daba 6

En mi código el error es este:

Private Sub agregar_Click()
ListBox1.AddItem Cbo_nombre.Value
a = ListBox1.ListCount - 1
ListBox1.List(a, 1) = Txt_telefono.Value
ListBox1.List(a, 2) = suma.Value

Dim varTotal As Long (esta línea no me dejaba ver dicimales)

Dim varRow As Integer
For varRow = 0 To (ListBox1.ListCount - 1)
varTotal = (varTotal) + (ListBox1.Column(2, varRow))
lblsuma = CDbl(varTotal)
NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"

Next

End Sub

Private Sub agregar_Click()
ListBox1.AddItem Cbo_nombre.Value
a = ListBox1.ListCount - 1
ListBox1.List(a, 1) = Txt_telefono.Value
ListBox1.List(a, 2) = suma.Value

(aquí está eliminada y así funcionó)

Dim varRow As Integer
For varRow = 0 To (ListBox1.ListCount - 1)
varTotal = (varTotal) + (ListBox1.Column(2, varRow))
lblsuma = CDbl(varTotal)
NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"

Next

End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas