+ Reply to Thread
Results 1 to 6 of 6

Removing Subtotals

  1. #1
    Registered User
    Join Date
    05-02-2012
    Location
    Richmond, VA
    MS-Off Ver
    Office 2010
    Posts
    15

    Removing Subtotals

    Here is the trouble.

    We recieve files throughout the month that contain subtotals. I need to remove them and create a table to be used elsewhere. Very simple you would think. I recorded a few macros that did the trick and edited them together, tested them several times till I got what I wanted and was very happy till I got the next file where it failed to work. The macro removed the subtotal feature, but left the subtotal lines in the spreadsheet forcing a manual process to filter out and delete those line. A little detective work showed the when clicking on the subtotal icon, the dialog did not reflect the subtotals in the table

    Actual Subtotal criteria was sum of Balance by Account Name. When clicking on the dialog it shows Sum of Notes by Invoice Number. When you click remove all it removes is the Subtotal features in the left window, but leaves each subtotal line, which then has to be filtered and deleted. The way around this is to fix the subtotal box, then click remove all, but I can't record this in my macro this way. It just says Cells.RemoveSubtotal.

    This must sound confusing. Ask away and I'll try to clarify. If I can get through this subtotals problems, the rest is not too dificult.

    Thanks in advance.
    Last edited by paul h; 02-18-2014 at 12:08 PM.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Removing Subtotals

    can you upload a file with confidential info removed?....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    05-02-2012
    Location
    Richmond, VA
    MS-Off Ver
    Office 2010
    Posts
    15

    Re: Removing Subtotals

    This should do it. Run Reformat.
    Attached Files Attached Files

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Removing Subtotals

    If I understand this once you have removed the subtotals you want to deleted all of the rows that were the subtotals and grand totals?....this piece of code will do that....

    Please Login or Register  to view this content.
    you can change the IF statement to delete whatever you want....this deletes any rows that don't start with "I"
    Last edited by judgeh59; 02-18-2014 at 01:04 PM. Reason: More Info

  5. #5
    Registered User
    Join Date
    05-02-2012
    Location
    Richmond, VA
    MS-Off Ver
    Office 2010
    Posts
    15

    Re: Removing Subtotals

    What I want if for the subtotals to be removed by the subtotal tool. I don't understand why these ghosts are remaining behind. I can program around it. It just doesn't seem necessary.

    If I start with a flat table and add subtotals, I get something close to what they are sending me. If I reverse the process, it goes back to a flat table. It seems this should do the same thing. I can't figure out why it doesn't. The real solution is to get the vendor to send me the flat file, but until then I though I could just remove subtotals, delete a few rows and move on. Really it just bugs me, but I'll get over it. It's tough being OCD.

    Thanks for your contribution.

    Paul
    Last edited by paul h; 02-18-2014 at 02:12 PM.

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Removing Subtotals

    Sorry. I'm seeing where/why it's not clearing either....I'm not sure I can help....

+ 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. Macro for removing subtotals that equal zero including the lines that make up the total
    By vasanti bhudia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2013, 12:51 PM
  2. Removing multiple subtotals at one go from pivot table
    By drajanm in forum Excel General
    Replies: 1
    Last Post: 05-26-2012, 12:43 AM
  3. Removing Subtotals
    By rushdenx1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-04-2007, 01:53 PM
  4. Quickly Removing Subtotals in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-27-2007, 09:20 AM
  5. [SOLVED] Problem with nested subtotals, placing secondary subtotals BELOW .
    By Dawn Cameron in forum Excel General
    Replies: 1
    Last Post: 06-03-2005, 06:05 PM

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