+ Reply to Thread
Results 1 to 44 of 44

pivot table not listing things in one row

Hybrid View

  1. #1
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: pivot table not listing things in one row

    @colts12og

    Maybe you missed my solution with an filter in #15.

    I can open the file from benishiryo.

    Maybe you are not allowed to work with macros?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  2. #2
    Registered User
    Join Date
    12-20-2012
    Location
    los angeles
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: pivot table not listing things in one row

    @oeldere,

    #15 what are the step you are using and what what are you asking to filter?

    I am able to use macros..

    Moderators Note:
    • As per Forum Rule #12, please don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Last edited by jeffreybrown; 01-26-2013 at 02:20 PM.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: pivot table not listing things in one row

    HI COLTS12OG

    This Code works on your Sample File. It'll need to be reworked a bit to handle your Real File. Please provide the information requested.

    The Merge Rows Code was adapted from Code written by Jindon here
    http://www.excelforum.com/excel-prog...e-columns.html

    Run the Code with Sheet yty active. Let me know of issues.
    Option Explicit
    Dim LR As Long
    Dim LC As Long
    Dim Rng As Range
    Dim i As Long
    
    Sub Delete_Empty_Rows()
        With ActiveSheet
            LR = .Cells.Find("*", .Cells(Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
                    SearchDirection:=xlPrevious).Row
    
            LC = .Cells.Find(What:="*", After:=[A1], _
                    SearchOrder:=xlByColumns, _
                    SearchDirection:=xlPrevious).Column
            Set Rng = .Range("D2:D" & LR)
            With Rng
                For i = LR To 1 Step -1
                    Application.ScreenUpdating = False
                    If Not IsNull(Rng(i).Resize(1, LC - 3).Text) Then
                        Rng(i).EntireRow.Delete
                    End If
                Next i
            End With
            .UsedRange.Replace What:="-*", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, _
                    MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
    
            Call Merge_Rows
            
            .UsedRange.Offset(1, 3).NumberFormat = "h:mm"
        End With
        Application.ScreenUpdating = True
    
    End Sub
    
    ' From http://www.excelforum.com/excel-programming-vba-macros/893749-merge-duplicate-rows-and-combine-data-in-some-of-the-same-columns.html
    Sub Merge_Rows()
        Dim Dic As Object
        Set Dic = CreateObject("Scripting.Dictionary")
        With Range("A1").CurrentRegion
            For i = 1 To .Rows.Count
                If i < .Rows.Count Then
                    If Not Dic.exists(.Cells(i, 2).Value) Then
                        Set Dic(.Cells(i, 2).Value) = .Rows(i).Range(Cells(1, 4), Cells(1 & LC))
                    Else
                        Dic(.Cells(i, 2).Value).Value = _
                                .Parent.Evaluate(Dic(.Cells(i, 2).Value).Address & "&" _
                                & .Rows(i).Range(Cells(1, 4), Cells(1 & LC)).Address)
                        .Rows(i).EntireRow.Delete
                        i = i - 1
                    End If
                End If
            Next
        End With
    End Sub
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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