+ Reply to Thread
Results 1 to 4 of 4

Pivot Table/Removal of Total Lines

Hybrid View

  1. #1
    Registered User
    Join Date
    02-23-2012
    Location
    Jill Phillips
    MS-Off Ver
    Excel 2011
    Posts
    13

    Pivot Table/Removal of Total Lines

    Hi,

    I am struggling a bit with the attached file. Is there a simple way to remove the "Total" row for each customer?
    I would like to use this data in a pivot table eventually which I know how to do. Not sure if there is a simple way to remove these rows all at once. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Pivot Table/Removal of Total Lines

    Try this code
    Option Explicit
    
    Sub delete_totals()
    Dim i As Long, lrow As Long
    
    Application.ScreenUpdating = False
    
    With Worksheets("Sheet1")
        lrow = .Range("A" & .Rows.Count).End(xlUp).Row
        For i = lrow To 2 Step -1
            If .Range("A" & i).Value Like "Total*" Then
                .Rows(i).Delete
                lrow = lrow - 1
            End If
        Next i
    End With
    
    Application.ScreenUpdating = True
    
    End Sub
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-23-2012
    Location
    Jill Phillips
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Pivot Table/Removal of Total Lines

    Worked beautifully. Thank you so much!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Pivot Table/Removal of Total Lines

    Go to Data menu and click the Filter button.

    click the drop down that appears in column A, select Text Filters and then Select Contains (or Begins With) and enter the word Total and click Ok.

    Then select all the rows and then Right-click and select Delete Rows.

    Then click the Filter button again to deactivate the filter... you should see no more Total rows.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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