Thanks, this worked! Alt F11 opened the VB, but there was no window for me to write my code. Took a while, eventually had to click on a VB Sheet. You saved me alot of manual work!
Is there a way to rearrange pages within a worksheet where there are multiple pages in ine sheet. And Also, is it possible to add in another page from a different sheet if the cells are of different sizes and formatting?
Here's a question! Is there any way I can insert a "soft" page break in EXCEL? In other words, an "allowable" page break location, that might or might not be used to break to the next page, depending on whether the next entire block of rows will fit on the rest of the page? The idea here would apply to groups of rows within EXCEL, but it would be analogous to the "keep lines together" option in Microsoft Word's Paragraph Formatting Dialog box, on the Line and Page Breaks tab. I ask because I have a spreadsheet with several calculation tables. I don't want rows from my tables to split up between pages if it can be avoided, but I'd also like to keep as many tables to a page as possible, so that each page is used up reasonably. I could set up page breaks manually, but since a few of the tables (not all) have up to 30 rows of calculations (individual rows hidden or visible as needed), this could be a lot of manual effort every time I go to create a PDF. I found something called "Conditional Page Breaks" online, but I couldn't figure it out whether it applies to my problem or not. Please let me know if you have any hints, or other features of excel that I should investigate. I'm using Excel 2019. Thanks!
This macro did not work in Excel 2016. I do not know how to make it work if I add the Function posted by the other member. Update: I thought it did not work, then I saw the page breaks. I am glad it worked!
This made perfect sense, but for some reason the VBA code generates a compile error right at Before:=Cell. The error message is 'expresson expected, and it highlights the :=Cell. I am not a VBA programmer but it all seemed straightforward. I Typed and re typed your text several times in case that the cause of the problem was somewhere fore the problem. No Luck. Is the := and actual single symbol which I don't know how to locate, or is it just a composite of the colon and the equal sign? Anyway, I am going with subtotals anyway because the make more sense for what I am doing. Nevertheless, I could see wanting to try this method so if you have any clues, let me know. (I assume the VBA source code environment is not case sensitive)
Put a Space between Add and _ It also happened to me, but through research I found the error is only because of the space. Before: ..... .Add_ With space: ..... .Add _
Didn't work for me... :-( For "Compile Error: Expected Expression" when I entered the Before:=Cell line at the end of the VBA.... And of course TH-cam won't allow links in comments so I cannot show you it. Thanks a lot TH-cam.
@@littlehennardgirl Put a Space between Add and _ It also happened to me, but through research I found the error is only because of the space. Before: ..... .Add_ With space: ..... .Add _
@@JMRogan Put a Space between Add and _ It also happened to me, but through research I found the error is only because of the space. Before: ..... .Add_ With space: ..... .Add _
09.05.2024 - You just saved me $1,200 with this video + multiple headaches. Thank you for creating this content!!!!
Lol we had similar issues at the same time, if you wanna do the same thing but with words instead you can use the exact function.
Thanks, this worked! Alt F11 opened the VB, but there was no window for me to write my code.
Took a while, eventually had to click on a VB Sheet.
You saved me alot of manual work!
Best tip ever! Saved me hours!
Is there a way to rearrange pages within a worksheet where there are multiple pages in ine sheet. And Also, is it possible to add in another page from a different sheet if the cells are of different sizes and formatting?
Good one Mr. Excel.
Here's a question! Is there any way I can insert a "soft" page break in EXCEL? In other words, an "allowable" page break location, that might or might not be used to break to the next page, depending on whether the next entire block of rows will fit on the rest of the page? The idea here would apply to groups of rows within EXCEL, but it would be analogous to the "keep lines together" option in Microsoft Word's Paragraph Formatting Dialog box, on the Line and Page Breaks tab.
I ask because I have a spreadsheet with several calculation tables. I don't want rows from my tables to split up between pages if it can be avoided, but I'd also like to keep as many tables to a page as possible, so that each page is used up reasonably. I could set up page breaks manually, but since a few of the tables (not all) have up to 30 rows of calculations (individual rows hidden or visible as needed), this could be a lot of manual effort every time I go to create a PDF.
I found something called "Conditional Page Breaks" online, but I couldn't figure it out whether it applies to my problem or not. Please let me know if you have any hints, or other features of excel that I should investigate. I'm using Excel 2019.
Thanks!
This macro did not work in Excel 2016. I do not know how to make it work if I add the Function posted by the other member.
Update: I thought it did not work, then I saw the page breaks. I am glad it worked!
Copy your code. Paste it in a reply. I can test it here.
Sir is there any trick of vba for automatically page break
This made perfect sense, but for some reason the VBA code generates a compile error right at Before:=Cell. The error message is 'expresson expected, and it highlights the :=Cell. I am not a VBA programmer but it all seemed straightforward. I Typed and re typed your text several times in case that the cause of the problem was somewhere fore the problem. No Luck. Is the := and actual single symbol which I don't know how to locate, or is it just a composite of the colon and the equal sign? Anyway, I am going with subtotals anyway because the make more sense for what I am doing. Nevertheless, I could see wanting to try this method so if you have any clues, let me know. (I assume the VBA source code environment is not case sensitive)
Put a Space between Add and _
It also happened to me, but through research I found the error is only because of the space.
Before: ..... .Add_
With space: ..... .Add _
this is the best
Didn't work for me... :-(
For "Compile Error: Expected Expression" when I entered the Before:=Cell line at the end of the VBA....
And of course TH-cam won't allow links in comments so I cannot show you it. Thanks a lot TH-cam.
@@littlehennardgirl I think people have been getting the same error for almost 7 years now! But not everyone. So go figure.
@@littlehennardgirl Put a Space between Add and _
It also happened to me, but through research I found the error is only because of the space.
Before: ..... .Add_
With space: ..... .Add _
@@JMRogan Put a Space between Add and _
It also happened to me, but through research I found the error is only because of the space.
Before: ..... .Add_
With space: ..... .Add _
This macro did not work.
Did you get an error message? Tell me more. Copy and paste your code and I can try it here.