Paste range on new page when it doesn't fit on current one

pluginguin

New Member
Joined
Aug 10, 2016
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
Hi all,

I have an excel file that populates a quotation sheet using several user forms that refer to source sheets (products, accessoiries, work/hours, etc.)

The view mode of the quotation sheet is set to "Page Layout".

I run into an issue when one of the userforms wants to paste something which range is more than 1 row. (Let's say it is 4 rows long.)
If there are only 2 rows left on the current page, the range will be partly pasted in the current page and partly on the next page.

How can I determine in vba at what row the next page starts?
With that information I could calculate if the selection I am about to paste would fit on the current page. And if not, the selection should be pasted entirely on the new page so it doesn't get split up.

Any ideas on this would be appreciated.

As a second best solution I could also accept some code that will make the paste action take place on a new page by default.
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

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