Sumar en un formulario volores que se encuentren en Textbox

Necesito censar los días pendientes de disfrute de vacaciones de los trabajadores, desde 2009 hasta 2014, para esta deje 6 textbox para que quien use el archivo pueda llenar esa información, al final coloque un textbox que quisiera que sumara los días pendientes de 2009 a 2014.

1 Respuesta

Respuesta
2

Me puedes enviar tu archivo y explicarme con más detalle y con ejemplos lo que necesitas.

Mil Gracias Dam, Excelente es poco!!!

Anexo las macros para actualizar la respuesta

Private Sub DTP_OrigBW_Change()
'Por.DAM
Sumar
TextBox14 = ""
TextBox13 = ""
DTPicker1.mindate = DTP_OrigBW
End Sub
Private Sub DTPicker1_Change()
'Por.DAM
Sumar
TextBox14 = ""
TextBox13 = ""
uf = Sheets("No laborable").Range("A" & Rows.Count).End(xlUp).Row
dias = Application.NetworkDays(DTP_OrigBW, DTPicker1, Range("A3:A" & uf))
If dias > Val(TextBox8) Then
    MsgBox "Total días Bloque 1 : " & dias & ", Total días Pendientes :" & TextBox8 & vbCr & vbCr & _
        "Los días del Bloque 1, no pueden ser mayores al TOTAL", vbCritical, "PLANEACIÓN"
    DTPicker1.SetFocus
    Exit Sub
End If
TextBox14 = dias
TextBox8.Text = Format(TextBox8 - TextBox14)
End Sub
Private Sub DTPicker3_Change()
'Por.DAM
Sumar
TextBox8.Text = Format(TextBox8 - TextBox14)
TextBox13 = ""
uf = Sheets("No laborable").Range("A" & Rows.Count).End(xlUp).Row
dias = Application.NetworkDays(DTPicker2, DTPicker3, Range("A3:A" & uf))
If dias > Val(TextBox8) Then
    MsgBox "Total días Bloque 2 : " & dias & ", Total días Pendientes :" & TextBox8 & vbCr & vbCr & _
        "Los días del Bloque 2, no pueden ser mayores al TOTAL", vbCritical, "PLANEACIÓN"
    DTPicker3.SetFocus
    Exit Sub
End If
TextBox13 = dias
TextBox8.Text = Format(TextBox8 - TextBox13)
End Sub
Private Sub TextBox1_Change()
Sumar
End Sub
Private Sub TextBox2_Change()
Sumar
End Sub
Private Sub TextBox3_Change()
Sumar
End Sub
Private Sub TextBox4_Change()
Sumar
End Sub
Private Sub TextBox5_Change()
Sumar
End Sub
Private Sub TextBox6_Change()
Sumar
End Sub
Private Sub Sumar()
Dim Suma As Double
Suma = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text)
TextBox8.Text = Format(Suma)
End Sub
Private Sub TextBox7_AfterUpdate()
valor = TextBox7
Set busca = Sheets("BASE").Range("a1:a" & Range("a65000").End(xlUp).Row).Find(valor, LookIn:=xlValues, lookat:=xlWhole)
If Not busca Is Nothing Then
TextBox10.Value = busca.Offset(0, 1)
End If
End Sub

sal u dos

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas