macro break page for each range based on ending of month

Alaa mg

Active Member
Joined
May 29, 2021
Messages
343
Office Version
  1. 2019
Hi Guys !

I search for macro to create break page for each range based on ending of month into first sheet . so the range is from column A: H . the column A is date DD\MM\YYYY .

so when end the date for each month for each range like 28 or 30 or 31 , then should break page after number of ending for that month for each range separately from the beginning to end and move to next range and create break page based on number of ending for that month so on .
thanks
 
I understand what you are trying to do, but since you have not shown us what your data looks like, how large your margins are, how high your rows are, how wide your columns are, etc, we are dependent upon you answering our questions to fill in the details.

So can you please do all that I asked in the previous email and tell me the results?
This will help give us a clue what is going on, and how we might be able to get it to do what you want.

Even better would be if you could post a image of the entire first sheet from Print Preview.
Like they say, a picture is often better than 1000 words!
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
the high row is 21 and wide of column min 13 and max 20 it depends on size of data into cells based on the headers .

as to margin top,down=0.75 right,left=0.25 I use least thing for the margin to shows all of the columns in the page .
1.PNG
 
Upvote 0
It looks like there should be enough room for a few extra lines.

Try the following on a NEW sheet with no page breaks added yet.
1. Run a Print Preview, and what is the last row it shows on the first page?
2. Run the VBA code I provided.
3. Run another Print Preview, and what is the last row it shows on the first page now?
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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