Repetir filas inferiores al imprimir en excel
Para Dante Amor
Cordial saludo, deseandole muchas bendiciones en todos los aspectos.
Agradezco de antemano su apoyo con el siguiente tema, tengo un formato que se encuentra en una hoja de nombre Factura (Hoja1), lo alimento mediante el uso de un formulario "Facturacion", el formato está diseñado para ingresar máximo 16 ítems por hoja impresa, hasta aquí todo me funciona bien, la dificultad que tengo es cuando al formato se ingresan más de 16 ítems en cuyo caso la impresión se debe realizar en cuantas hojas sea necesario, teniendo en cuenta que en cada hoja solo deben de ir 16 ítems y que en cada hoja se debe repetir además del emcabezado que con eso no tengo problema, las filas inferiores del formato standard que van de la fila 37 a la 56, el contenido de estas filas se debe repetir en cuantas hojas sea necesario imprimir, espero haberme hecho entender con la explicacion de la dificultad que tengo.
Adjunto código que aliementa el formato e imágenes de cómo debería quedar
'Guardar la informacion
Private Sub Btn_Aceptar_Click()
Dim validarfecha As Boolean
Dim i As Integer
Dim j As Integer
If TextBox7 = "" Then 'nro de fact
MsgBox "Introduzca NRO.DE FACTURA", , "Gilber dice:"
TextBox7.SetFocus
Exit Sub
End If
'Paso la informacion al formato de la FV
' ActiveWorkbook.Unprotect "1717171"
Set hfv = Sheets("Factura")
hfv.Unprotect "1717171"
' hfv.Visible = xlSheetVisible 'Hoja Factura
'Eliminar filas que sobran
Set f = hfv.Range("B:N").Find("SUBTOTAL ", , xlValues, xlPart, , xlPrevious, False)
If Not f Is Nothing Then
If f.Row > 37 Then hfv.Range("B37:B" & f.Row - 1).EntireRow.Delete
End If
hfv.Select
Range("A20:N36") = ""
With ListBox2
j = .ListCount + 1
If j > 16 Then
hfv.Rows(36).Copy
hfv.Rows("36:" & 36 + j - 18).Insert Shift:=xlDown
Application.CutCopyMode = False
End If
'Pasar la informacion al formato
j = 20
For i = 0 To .ListCount - 1
hfv.Cells(j, 1) = .List(i, 0) 'cod
hfv.Cells(j, 5) = .List(i, 1) 'Cantidad
hfv.Cells(j, 3) = .List(i, 2) 'Descripcion
hfv.Cells(j, 7) = .List(i, 3) 'Vr.Unitario
'pasa unid e iva del item
Set buscoit = Hoja2.Range("A:A").Find(Val(ListBox2.List(i, 0)), LookIn:=xlValues, lookat:=xlWhole)
If Not buscoit Is Nothing Then
hfv.Cells(j, 8) = buscoit.Offset(0, 6) / 100 'IVA
Set buscoit = Nothing
End If
'Calcular Vr.Total de la linea item * cantidad
hfv.Cells(j, 11) = Round(hfv.Range("E" & j) * hfv.Range("G" & j) / (1 + hfv.Range("H" & j)), 0)
j = j + 1
Next
End With
'Consecutivo
Hoja1.Range("I10") = "AB - " & TextBox7.Value 'Nro FV
End sub 
