Hello,
I have a sheet with four equal-sized ranges (A2:Z44, A46:Z88, A90:Z132, and A134:Z176), in which the user can hide/show rows of data using Group/Ungroup (the top and bottom line of each range is always visible).
I have a print button attached to VBA code that will set the page setup options and print based on user cell inputs (print 1,2,3 or all 4 of the ranges; portrait or landscape orientation).
What I would like to do is for the code to recognize how many lines are visible in each range, and then decide if and where a page break should be placed between the ranges. Potentially each range could be as short as 23 rows, or as long as 43 rows. So, for example, if each range is 43 rows, it will place a page break at row 89 (midpoint) and break across two pages, or if they each are 23 rows, it won't need to insert a page break and will instead be fit to 1 page wide and 1 page tall. Anybody have an idea? Thanks!
I have a sheet with four equal-sized ranges (A2:Z44, A46:Z88, A90:Z132, and A134:Z176), in which the user can hide/show rows of data using Group/Ungroup (the top and bottom line of each range is always visible).
I have a print button attached to VBA code that will set the page setup options and print based on user cell inputs (print 1,2,3 or all 4 of the ranges; portrait or landscape orientation).
What I would like to do is for the code to recognize how many lines are visible in each range, and then decide if and where a page break should be placed between the ranges. Potentially each range could be as short as 23 rows, or as long as 43 rows. So, for example, if each range is 43 rows, it will place a page break at row 89 (midpoint) and break across two pages, or if they each are 23 rows, it won't need to insert a page break and will instead be fit to 1 page wide and 1 page tall. Anybody have an idea? Thanks!