Pregunta para Luis Mondelo: Cambio estado y sumar
Hola Luis Mondelo. Me enviaste esta Macro. Resulta que al ejecutar por segunda vez la macro me borra lo que había sumado. (Estando con la misma fecha) Se puede dejar que al no encontrar otra fecha distinta (b1) deje la suma tal cual?
Sub proceso()
'por luismondelo
fecha = Sheets("hoja2").Range("b1").Value
Sheets("hoja1").Select
Range("c2").Select
Do While ActiveCell.Value <> ""
If UCase(ActiveCell.Value) = "CARTERA" And ActiveCell.Offset(0, 3) <= fecha Then
ActiveCell.Value = "DEP/PAG"
ActiveCell.Offset(0, 2).Value = 0
If ActiveCell.Offset(0, 3).Value = fecha Then
suma = suma + ActiveCell.Offset(0, 1).Value
End If
End If
ActiveCell.Offset(1, 0).Select
Loop
Sheets("hoja2").Range("b3").Value = suma
End Sub

1 respuesta
Respuesta de Luis Mondelo
1
