Macro para ejecutar el copiado de datos a un tablero 1 vez.

Para Dante Amor.

Hola Dante, gracias por la macro que preparaste tan de manera profesional y me enviaste por correo.

Ahora me surge una necesidad y es la de copiar los datos de los cuadros al tablero, solo una vez.

Espero puedas ayudarme con la macro para hacer esta tarea.

Desde ya gracias.

Luis Carlos

1 respuesta

Respuesta
1

Esta macro ejecutará solamente una vez el tablero:

Sub unacopia()
'Por.Dante Amor
    Application.ScreenUpdating = False
    CopiarTablero
    Application.ScreenUpdating = True
End Sub

Esta es la macro del tablero:

Sub CopiarTablero()
'Por.Dante Amor
    Set h1 = Sheets("IGPA")
    Set h2 = Sheets("Tablero")
    '
    ini = h2.[Z1]
    If ini = "" Then
        ini = 3
    End If
    h2.Range("B4:G13").Clear
    '
    For i = ini + 1 To h1.Range("F" & Rows.Count).End(xlUp).Row + 20
        If h1.Cells(i, "F") = "" Then
            fin = i - 1
            Exit For
        End If
    Next
    '
    n = 0
    For i = fin + 1 To h1.Range("F" & Rows.Count).End(xlUp).Row + 20
        If h1.Cells(i, "F") <> "" Then
            h2.[Z1] = i
            Exit For
        End If
        n = n + 1
        If n = 10 Then
            h2.[Z1] = 3
            Exit For
        End If
    Next
    h1.Range("F" & ini & ":K" & fin).Copy h2.[B4]
    bordes h2
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas