Copiar celdas y la fila activa de una hoja a otra de manera consecutiva.

Necesito copiar la celda B2, C2, B3, C3 C4, C5, C6, C7 y C8 de la hoja "PLAZAS" y la fila activa copiarla a la hoja "INF TOTAL". En ese orden; es decir primero las celdas mencionadas y después en la misma fila toda la información de la fila activa.

esta es la hoja "INF TOTAL"

1 respuesta

Respuesta
2

Te anexo la macro

Sub Copiar_Datos()
'Por.Dante Amor
    Set h1 = Sheets("PLAZAS")
    Set h2 = Sheets("INF TOTAL")
    h1.Select
    If ActiveCell.Row < 11 Then
        MsgBox "Selecciona una fila correcta"
        Exit Sub
    End If
    '
    f = ActiveCell.Row
    'B2, C2, B3, C3 C4, C5, C6, C7 y C8
    u2 = h2.Range("A" & Rows.Count).End(xlUp).Row + 1
    h2.Cells(u2, "A") = h1.[B2]
    h2.Cells(u2, "B") = h1.[C2]
    h2.Cells(u2, "C") = h1.[B3]
    h2.Cells(u2, "D") = h1.[C3]
    h2.Cells(u2, "E") = h1.[C4]
    h2.Cells(u2, "F") = h1.[C5]
    h2.Cells(u2, "G") = h1.[C6]
    h2.Cells(u2, "H") = h1.[C7]
    h2.Cells(u2, "I") = h1.[C8]
    uc = h1.Cells(f, Columns.Count).End(xlToLeft).Column
    h1.Range(h1.Cells(f, "A"), h1.Cells(f, uc)).Copy h2.Range("J" & u2)
    MsgBox "Datos Copiados"
End Sub

.

'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

.

Avísame cualquier duda

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas