+ Reply to Thread
Results 1 to 7 of 7

Create a list in another sheet based on few conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Create a list in another sheet based on few conditions

    Dear Friends & Gurus,

    I am having a worksheet consist of some 8000 records.

    I need a list of Higest to Lowest counts of Level A1 (column H2:L8000) - (ONLY A1) - Grouped by SUBCODE. I have explained the details of result to be accomplised in the ATTACHED SAMPLE FILE.

    I seek your kind expertise in this regard.

    Thanks in advance.

    acsishere.
    Attached Files Attached Files
    Last edited by VBA Noob; 05-12-2008 at 03:11 PM.

  2. #2
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Smile Dear Friends,

    Best Wishes!

    Any solution for the above?

    Thanks in advance,

    acsishere.

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Smile Dear Friends,

    Best wishes!

    Any help for the above is highly appreciated.

    Thanks in advance,

    acsishere.

  4. #4
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Smile Dear Friends,

    I am badly in need of a solution.

    Can any one help.

    Thanks in advance.

    acsishere.

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Smile Dear Friends & Gurus

    Any help is highly appreciated.

    Thanks in advance.

    acsishere.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    See how this goes. Haven't done anything about the formatting, just want to see if the output is OK.

    Sub aaa()
      Dim OutSH As Worksheet
      Set OutSH = Sheets("Sheet2")
      OutSH.Cells.ClearContents
      Sheets("Sheet1").Select
      For Each ce In Range("B2:B" & Cells(Rows.Count, 2).End(xlUp).Row)
        outrow = OutSH.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
        OutSH.Cells(outrow, 1).Value = WorksheetFunction.CountIf(Range("H" & ce.Row & ":L" & ce.Row), "A1")
        OutSH.Cells(outrow, 2).Value = ce.Offset(0, 2).Value
        OutSH.Cells(outrow, 3).Value = ce.Value
        OutSH.Cells(outrow, 4).Value = ce.Offset(0, 1).Value
      
      Next ce
      With OutSH
        .Range("A2:D" & .Cells(Rows.Count, 1).End(xlUp).Row).Sort key1:=.Range("A2"), order1:=xlDescending, key2:=.Range("B2"), order2:=xlAscending, header:=xlNo
        .Range("E2").Formula = "=SUMPRODUCT(--($A$2:$A$" & .Cells(Rows.Count, 1).End(xlUp).Row & "=A2),--($B$2:$B$" & .Cells(Rows.Count, 1).End(xlUp).Row & "=B2))"
        .Range("E2").AutoFill Destination:=.Range("E2:E" & .Cells(Rows.Count, 1).End(xlUp).Row)
        .Range("E:E").Value = .Range("E:E").Value
        For Each ce In .Range("A3:A" & .Cells(Rows.Count, 1).End(xlUp).Row)
          If ce.Offset(-1, 0).Value = ce.Value And ce.Offset(-1, 1).Value = ce.Offset(0, 1).Value Then
            ce.ClearContents
            ce.Offset(0, 1).ClearContents
            ce.Offset(0, 4).ClearContents
          End If
        
        Next ce
      End With
    End Sub
    rylo

  7. #7
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Thumbs up Dear Mr. Rylo,

    Once again THANKS for the help. You did it exactly as I required.

    Excellent and great.

    Thanks, Thanks, Thanks...... a lot for your support.

    acsishere.

+ 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