pluginguin
New Member
- Joined
- Aug 10, 2016
- Messages
- 21
- Office Version
- 2019
- Platform
- 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.
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: