Actualizar Histórico cada vez que se abre una Excel

Espero estés muy bien.

Quisiera hacer una modificación en un programita que corre bien

  1. Documentar en un histórico los % de VENCIMIENTO de los Programados (hasta ahora están referidos a HOY() y cada vez que se abre la Planilla, muestra valores en función de HOY() è significa que los Programados están actualizados …. Y no es verdad)
  2. En un WORD quisiera adelantarte la idea con pantallas a lo que me estoy refiriendo x mail privado
  3. Un abrazo y

1 respuesta

Respuesta
1

Te anexo macro actualizada para "pisar" los datos en el histórico

Private Sub Worksheet_Activate()
'Por.Dante Amor
    Set h1 = ActiveSheet
    Set h2 = Sheets("HISTORICO")
    fec = Date
    Set b = h2.Columns("A").Find(Year(Date), lookat:=xlPart)
    If Not b Is Nothing Then
        f = b.Row
        Set b = h2.Rows(f).Find(fec, lookat:=xlWhole)
        If Not b Is Nothing Then
            c = b.Column
            'If h2.Cells(f + 1, c) = "" Then
                h2.Cells(f + 1, c) = h1.[Q4]
                h2.Cells(f + 2, c) = h1.[Q5]
            'End If
        Else
            uc = h2.Cells(f, Columns.Count).End(xlToLeft).Column + 1
            h2.Cells(f, uc) = fec
            h2.Cells(f + 1, uc) = h1.[Q4]
            h2.Cells(f + 2, uc) = h1.[Q5]
        End If
    Else
        u = h2.Range("A" & Rows.Count).End(xlUp).Row + 2
        h2.Cells(u, "A") = "AÑO " & Year(Date)
        h2.Cells(u + 1, "A") = "Ficticios"
        h2.Cells(u + 2, "A") = "Programados"
        h2.Cells(u, "B") = fec
        h2.Cells(u + 1, "B") = h1.[Q4]
        h2.Cells(u + 2, "B") = h1.[Q5]
    End If
End Sub

La macro va en los eventos de la hoja "Análisis Entregas"

Sal u dos

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas