Copy a form multiple times from page break view

Carlos13

New Member
Joined
Apr 7, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I want to copy many times a form on the same sheet where it is, it is curious, but they use it at work I think to homogenize the records and records. The example I have is to copy the form (first image) 50 times on the same sheet quickly and without having to go down all the way moving the page breaks (second image), to in the end only always print the same number of pages separately.
1693120169469.png
1693120224230.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I want to copy many times a form on the same sheet where it is, it is curious, but they use it at work I think to homogenize the records and records. The example I have is to copy the form (first image) 50 times on the same sheet quickly and without having to go down all the way moving the page breaks (second image), to in the end only always print the same number of pages separately.
View attachment 97831View attachment 97832
Try this.

I have assumed that the from is in the range A1 to E16.

Change this line if it is anything different.

Set rngForm = .Range("A1:E16")

Make sure the sheet with the form is the active sheet.

VBA Code:
Public Sub subCopyFormSetPageBreaks()
Dim rngForm As Range
Dim WsForm As Worksheet
Dim i As Integer
   
    Set WsForm = ActiveSheet
           
    With WsForm

        Set rngForm = .Range("A1:E16")
       
        For i = 1 To 50
       
            rngForm.Copy Destination:=.Range("A" & (i * rngForm.Rows.Count) + 1)
               
            .Rows((i * rngForm.Rows.Count) + 1).PageBreak = xlPageBreakManual
       
        Next i

    End With

End Sub
 
Last edited:
Upvote 0
Very good, but it didn't quite do what I expected because it didn't recognize the page breaks.
 
Upvote 0
Very good, but it didn't quite do what I expected because it didn't recognize the page breaks.
What do you mean by that?

Did it put in the page breaks?

If not then were the original page breaks still thare?
 
Upvote 0
Exactly, only the original page break was left and did not put the new ones. He only left the one on page one and did not recognize the others.

I just tried it and it assumes me as a page all the repetitions. It's not what I want either.
1693264605294.png
 
Upvote 0
Are you saying that the form is repeated but the page breaks have not been added?

When you go into File, Print what do you see as far as pages?
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top