+ Reply to Thread
Results 1 to 3 of 3

Subtotals to move to next column

  1. #1
    Registered User
    Join Date
    01-20-2016
    Location
    london
    MS-Off Ver
    2010
    Posts
    2

    Subtotals to move to next column

    I am using Office 2010. I have some data on a spreadsheet (see attached picture).

    As you can see i need to seperate the transactions using "Account Titles".. I first sort out the data so all "account Titles" club together then I am using the Subtotal function in Data tab.. What it does is add a row after each total of "Account Title" and throws a subtotal in the "Gross" column, I then have to move each Subtotaled amount to the "Subtotal" column..

    Is there a way that it automatically moves the subtotal of each to the "Subtotal" column rather than me moving it from "Gross" column.12.jpg

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Subtotals to move to next column

    Welcome to the forum.

    I assume that you have a LOT of data so don't want to do it all manually. There's no formula-driven way to do this, but you can do it with this macro code:
    Please Login or Register  to view this content.
    For this to work, you must select a range which includes all the rows you want and it must include column G (Gross). Using the example you posted a pic of, you could select only G35:G50 and it will work for the three subtotals shown in the pic - but not any below them. Note that it will move the grand total (right at the bottom, not shown in your pic) too.

    If you haven't used macros before you'll need to go to:
    File - Options - Trust Center - Trust Center Settings - Macro Settings - select the second option down (disable all macros with notification) (you could use the fourth - enable all - but that's not recommended - this way you get to choose when/if to allow macros to run).
    Then:
    - Copy the code above to the clipboard
    - Open your Workbook
    - Press ALT + F11 to open the Visual Basic Editor.
    - Select 'Module' from the Insert menu
    - Type 'Option Explicit' (without the inverted commas) then paste the code under it
    - Press ALT + Q to close the VBEditor

    To run the macro, press ALT + F8 then select the macro name (OffsetSubtotals) and click 'Run'.
    You will need to save the file as a Macro-Enabled Workbook (.xlsm).

    Hope that helps.
    Last edited by Aardigspook; 01-20-2016 at 05:37 PM. Reason: Add clarification on required selection
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    01-20-2016
    Location
    london
    MS-Off Ver
    2010
    Posts
    2

    Re: Subtotals to move to next column

    Thanks for your help. I will try that today.

    Yes you are right, i have a lot of data to do a subtotal of and I did not think it would be so complicated haha but yeah thanks again, i will try it today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find the last used cell in a row and move to a column in the same row - Move to next row
    By usafmeinweg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2015, 02:42 AM
  2. Subtotals For 1 column
    By jonboy6257 in forum Access Tables & Databases
    Replies: 3
    Last Post: 09-17-2014, 02:01 AM
  3. Replies: 3
    Last Post: 07-30-2014, 08:56 AM
  4. [SOLVED] Move subtotals into new column
    By Ozzanif in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 03:46 PM
  5. How to create subtotals in more than one column
    By sentinela in forum Excel General
    Replies: 1
    Last Post: 07-02-2009, 09:15 AM
  6. copy subtotals to new column
    By shekar goud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2009, 08:59 AM
  7. copy subtotals to new column
    By shekar goud in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-04-2009, 06:39 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1