Columnas contabilidad
Publicado por Compumakro (4 intervenciones) el 26/05/2011 18:47:48
Amigos de Excel 2007
Gracias de antemano por su ayuda
Tengo 5 columnas:
A B C D E
Fecha.... Nombre.... Ingreso....Egreso....Saldo
La formula por aplicación corriente es: =E2+C3-D3
o sea el saldo que viene de la celda anterior de la columna "E", se le suma o se resta según la columna "C" o "D" que tenga la cifra.
Si lo hago así, me toca, o copiar siempre la formula a la celda siguiente manualmante, o jalar la esquina de la celda y copiar varias celdas y me da el mismo saldo en las siguientes 10 o 20 celdas.
Qué necesito:
Que cuando se genere una fecha, se active la celda siguiente en blanco de la columna "E" y me haga el cálculo
El siguiente ensayo, no me funciona, por una razón: No sirve.... pero les muestro mi intento.
Gracias
Oscar
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A3:A50,E3:E50")) Is Nothing Then Exit Sub
Dim Fila As Integer
For Fila = 3 To 50
If Cells(Fila, 3) > 0 And Cells(Fila, 3) Or Cells(Fila, 4) > 0 Then
Cells(Fila, 5) = Cells(Fila, 3) + Cells(Fila, 4) - Cells
Cells(Fila, 1) = Application.Count(Range(Cells(fila, 5), Cells(Fila, 7)))
End If
If Not IsEmpty(Cells(Fila, 2)) Then
Cells(Fila, 1) = Application.CountA(Range(Cells(1, 3), Cells(Fila, 3)))
Else
Cells(Fila, 1).ClearContents
End If
If IsEmpty(Cells(Fila, 3)) Or IsEmpty(Cells(Fila, 5)) Then
Cells(Fila, 5).ClearContents
End If
Next Fila
End Sub
Gracias de antemano por su ayuda
Tengo 5 columnas:
A B C D E
Fecha.... Nombre.... Ingreso....Egreso....Saldo
La formula por aplicación corriente es: =E2+C3-D3
o sea el saldo que viene de la celda anterior de la columna "E", se le suma o se resta según la columna "C" o "D" que tenga la cifra.
Si lo hago así, me toca, o copiar siempre la formula a la celda siguiente manualmante, o jalar la esquina de la celda y copiar varias celdas y me da el mismo saldo en las siguientes 10 o 20 celdas.
Qué necesito:
Que cuando se genere una fecha, se active la celda siguiente en blanco de la columna "E" y me haga el cálculo
El siguiente ensayo, no me funciona, por una razón: No sirve.... pero les muestro mi intento.
Gracias
Oscar
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A3:A50,E3:E50")) Is Nothing Then Exit Sub
Dim Fila As Integer
For Fila = 3 To 50
If Cells(Fila, 3) > 0 And Cells(Fila, 3) Or Cells(Fila, 4) > 0 Then
Cells(Fila, 5) = Cells(Fila, 3) + Cells(Fila, 4) - Cells
Cells(Fila, 1) = Application.Count(Range(Cells(fila, 5), Cells(Fila, 7)))
End If
If Not IsEmpty(Cells(Fila, 2)) Then
Cells(Fila, 1) = Application.CountA(Range(Cells(1, 3), Cells(Fila, 3)))
Else
Cells(Fila, 1).ClearContents
End If
If IsEmpty(Cells(Fila, 3)) Or IsEmpty(Cells(Fila, 5)) Then
Cells(Fila, 5).ClearContents
End If
Next Fila
End Sub
Valora esta pregunta
0