miércoles, 17 de mayo de 2023

EXCEL BAJO DATOS DE ARRIBA HACIA ABAJO

 Sub ABAJO()

If ActiveCell.Row > 77 Then Exit Sub  'MAXIMO DE FILAS

Dim ref1 As String

Dim EQUIPO1 As String

Dim equipo2 As String

Dim categoria1 As String


'guardamos datos originales de la celda activa

ref1 = Range("A" & ActiveCell.Row).Value

EQUIPO1 = Range("C" & ActiveCell.Row).Value

equipo2 = Range("F" & ActiveCell.Row).Value

categoria1 = Range("G" & ActiveCell.Row).Value


'ponemos los de la celda inferior en la activa

Range("A" & ActiveCell.Row).Value = Range("A" & ActiveCell.Row + 1).Value

Range("C" & ActiveCell.Row).Value = Range("C" & ActiveCell.Row + 1).Value

Range("F" & ActiveCell.Row).Value = Range("F" & ActiveCell.Row + 1).Value

Range("G" & ActiveCell.Row).Value = Range("G" & ActiveCell.Row + 1).Value


'ponemos en fila superior los de la celda activa

'que estñan guardados en las variables

Range("A" & ActiveCell.Row + 1).Value = ref1

Range("C" & ActiveCell.Row + 1).Value = EQUIPO1

Range("F" & ActiveCell.Row + 1).Value = equipo2

Range("G" & ActiveCell.Row + 1).Value = categoria1

Range("C" & ActiveCell.Row + 1).Select


End Sub

No hay comentarios:

Publicar un comentario