Año por año pregunta para dante amor

Dante ahí te estoy mandando el archivo por mail de nuevo porque cuando voy a año anterior no pasa todo el año revísalo y se queda en el año 2016 aparte cuando le agrego  Application.ScreenUpdating = False para que no tenga parpade va para cualquier lado me lo rebisas x favor graciassss tambien en casflow le quiese agregar  Application.EnableEvents = False y me elimina la fila celeste que que sigue al cursor

1 Respuesta

Respuesta
1

Te anexo la macro para el año anterior

Sub anterior_año()
'Por.Dante Amor
    Set d = ActiveCell
    If d.Column < 15 Then Exit Sub
    Sheets("CASHFLOW").Unprotect
    a = Cells(1, d.Column).MergeArea.Cells(1, 1).Column
    b = d.Column
    Application.EnableEvents = False
    Cells(d.Row, a).Select
    Siguiente_año
    If Cells(1, d.Column).Offset(0, 1) <> "" Then
        Cells(1, d.Column).Offset(0, -12).Select
        col = ActiveCell.Column
        ActiveWindow.SmallScroll ToRight:=5
        If ActiveCell.Column = 4 Then
            ActiveWindow.SmallScroll ToRight:=-5
        End If
        Cells(d.Row, col).Select
    End If
    Application.EnableEvents = True
    Sheets("CASHFLOW").Protect DrawingObjects:=True, Contents:=True, _
        Scenarios:=True, AllowFiltering:=True
End Sub

dante anda todo bien pero hace mucho parpadeo y cuando le pongo  Application.ScreenUpdating = False no anda bien porque es dante espero tu respuesta gracias

Cuando desactivas la actualización de la pantalla ya no se hacen los movimientos de desplazamiento de la pantalla

como cuando desactivo no te entiendo

que es lo que tengo que a hacer

Si desactivas la pantalla con esto

Application.ScreenUpdating = False

Significa que los movimientos en pantalla para moverse al año anterior no se reflejarán en tu monitor, a eso me refiero, si desactivas los movimientos no se estará moviendo la pantalla adecuadamente.

Prueba con esta macro

Sub anterior_año()
'Por.Dante Amor
    Set d = ActiveCell
    If d.Column < 15 Then Exit Sub
    a = Cells(1, d.Column).MergeArea.Cells(1, 1).Column
    Application.EnableEvents = False
    Cells(d.Row, a).Select
    Cells(d.Row, a - 12).Select
    If ActiveCell.Column > 4 Then
        ActiveWindow.SmallScroll ToRight:=5
    End If
    Application.EnableEvents = True
End Sub
Sub Siguiente_año()
'Por.Dante Amor
    Set C = ActiveCell
    If C.Column < 4 Then Cells(C.Row, 4).Select
    If Cells(1, C.Column).Offset(0, 1) <> "" Then
        Cells(1, C.Column).Offset(0, 1).Select
        col = ActiveCell.Column
        ActiveWindow.SmallScroll ToRight:=5
        Cells(C.Row, col).Select
    End If
End Sub
_____________________________________________________________
Sub anterior_año()
'Por.Dante AmorSet d = ActiveCell
    If d.Column < 15 Then Exit Sub
    a = Cells(1, d.Column).MergeArea.Cells(1, 1).Column
    Application.EnableEvents = False
    Cells(d.Row, a).Select
    Cells(d.Row, a - 12).Select
    If ActiveCell.Column > 4 Then
        ActiveWindow.SmallScroll ToRight:=5
    End If
    Application.EnableEvents = True
End Sub

dante estas son las dos macros que vos me hiciste se ejecutan perfecto pero tanto para siguiente como para anterior ano el parpadeo lo sigue haciendo haciendo
   

tengo ajustada la pantalla en 114%

perdón 112%

El parpadeo no se puede evitar

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas