How to make an Excel datasheet with a page subtotal
Similar print style in some financial software has been implemented, so we can use Excel with the function to achieve this effect.
Already have a master with VBA code or small tools to achieve. But for most cousins, using VBA code is a bit tricky.
The following figure, for example, assumes that we need to print 40 lines of content per page.
First, create secondary columns
Right-click a column label, select Insert in the Drop-down list, and insert a blank column.
A1 input column heading "auxiliary", A2 input formula:
=int (ROW (A40)/40)
Double-click the fill handle in the lower-right corner of the A2 cell to quickly fill the formula to the last row in the data area.
40 of the formula can be determined based on the actual number of rows printed per page. The formula is used to generate 40 1, 40 2, 40 3 ... Such a cyclic sequence.
Copy the contents of column A, and right-click to paste as a numeric value.
Ii. Use of subtotals
Click any cell in the data source, and then click Data, and then subtotal.
In the Subtotals dialog box that pops up:
Category field to select Secondary.
Summarize by selecting Sum.
Select Totals to check the amount (principal).
Subtotal dialog box, select each group of data pagination, and click OK.
The finished effect is shown in the following illustration: