Count Formula

dracron

New Member
Joined
Jan 10, 2014
Messages
32
I have a mail merge type thing going on where I pull over data and print and then it moves to the next in excel.
how I do this is by setting a first set record and a last set record.

It prints 10 to a page and then pulls the next 10 so on and so on
Lets say I have **45 records (this number is in cell A2 by a counta formula) I know that 5 pages will print, the first set of records (always) starts at 2 and then the last of set of records start at 42.
these are cell numbers, usually

What I want to do is have a formula that tells me where the last set of records will be based on the fact it always starts at 2 and has 10 records to a page.

Clear as mud?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi.

You mean something like this:
Code:
Sub Calculate_Last_Start_Row()

    Dim Start_Row As Long, N_per_Page As Long, N_Total As Long, Last_Start As Long
    
    Start_Row = 2
    N_per_Page = 10
    N_Total = 45
    
    Last_Start = Int(N_Total / N_per_Page) * N_per_Page + Start_Row

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

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