Subtotaling the Amount column (QBOL) |
Top Previous Next |
This example demonstrates:
Prior topics showed how to subtotal a column of numbers—the Qty (quantity) column, for example. The Amount column must be subtotaled a bit differently. QuickBooks Online requires assigning an account to items you create in the Products and Services list. So when you use an item to trigger a subtotal calculation on a form, you must be careful that you don't accidentally post income. That's what would happen if the macro wrote the subtotal in the Amount column! The solution is to put the subtotal in the Description column, where QuickBooks Online won't treat it as a financial amount and thus won't post the subtotal amount as income. Getting Ready Instead of using existing Products and Services items to trigger FullSpeed calculations, usually you should set up a new item for that purpose. This assures the item won't record income unless you want it to (if the Price/Rate is set to 0) and it lets the item provide any descriptive information you may want. Here's a new item, Subtotal, added for the purpose of triggering a subtotal calculation: Notes:
Use the item on a form Select the Subtotal item on the line immediately below each group of lines you want to subtotal. Set up the macro worksheet as shown below
As the screenshot below shows, the formula sums the Amount column but is entered in the Description column for the reasons given at the beginning of this topic.
Here's an example with some sample data entered in the Amount column, to verify formula's results: Notice that the formula actually sums the Sandbox rows of the Amount column. That is a shorthand way of telling FullSpeed to sum the entire Amount column when the macro runs.
Format the subtotal formula cell as currency The "23" calculated by the formula is correct, but when the macro runs it will need to be formatted as dollars and cents (currency). Right-click the formula's cell and select Format cell from the menu. Then select currency formatting with two decimal places:
Running the Macro In QuickBooks Online:
That's the column selected as the Begin field (shown in bright green in the macro worksheet above), and the macro needs to start on the first row of data.
FullSpeed will traverse the form, gathering data. As it reaches each Subtotal line it will put a subtotal in the Description field: |