snapshot help

krisso

Active Member
Joined
Sep 16, 2005
Messages
291
Book1.xls
ABCDEF
1F.ET.LAmountof3rdPartyChequesAmountofProlegalChequesTotalChequesOutstanding%Outstanding
2RXCRXC0000%
3KXBRXC1011%
4KXFRXC1122%
5MXFRXC0000%
6SYMRXC1011%
7RXPRXC4044%
8JXTRXC0000%
9JYTRXC0000%
10EXWRXC0000%
11PXVRXC0000%
12NXGNXG0000%
13MXBNXG1011%
14ADLNXG781514%
15AXKNXG0000%
16TXPNXG2022%
17NXSNXG1233%
Sheet1


what would be the easiest way to get this list to snapshot the top 10 outstanding totals to a different worksheet preferably in a macro or on opening the spreadsheet

Regards

Chris
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi,

If you add a 'Rank' column (see below), you can simply use autofilter to select the top 10:
Book1
ABCDEFG
1F.ET.LAmount of 3rd Party ChequesAmount of ProLegal ChequesTotal Cheques O/SO/SRank
2RXCRXC0000%9
3KXBRXC1011%6
4KXFRXC1122%4
5MXFRXC0000%9
6SYMRXC1011%6
7RXPRXC4044%2
8JXTRXC0000%9
9JYTRXC0000%9
10EXWRXC0000%9
11PXVRXC0000%9
12NXGNXG0000%9
13MXBNXG1011%6
14ADLNXG781514%1
15AXKNXG0000%9
16TXPNXG2022%4
17NXSNXG1233%3
Sheet1
 
Upvote 0
I have tried this and it doesn't work as it only gives me about 10 results for the list and i have 60 people in the list at present and its growing

regards

chris
 
Upvote 0
Hi Chris,

If you select 'Top Ten', you can change the number from 10 to whatever.

Alternatively, why not just sort the list in descending order of rank?
 
Upvote 0
Alan,

What i am saying is the rank formula show me less than 10 different numbers as results and it should show more, and i wanted to actually have the results shown on a different worksheet as opposed to the one i am working in.

Regards

chris
 
Upvote 0
Hi,

This code expects the following:
1) format of sheet 1 as per my previous post INCLUDING the ranking in column G
2) Output to be placed in Sheet2

Code:
Sub OSTop()
Const cCols As Integer = 7
Const cNumRqd As Integer = 10
Dim iCol As Integer, iCount As Integer, iArrayPtr As Integer
Dim lRow As Long, lRowEnd As Long
Dim R As Range
Dim sFirstAdd As String
Dim vTopOS() As Variant
Dim wsFr As Worksheet, wsTo As Worksheet
Set wsFr = Sheets("Sheet1")
Set wsTo = Sheets("Sheet2")

'*************************************
'** Clear 'To' sheet & set headings **
'*************************************
wsTo.Cells.ClearContents
wsTo.Range("A1:G1").Value = wsFr.Range("A1:G1").Value

lRowEnd = wsFr.Cells(Rows.Count, "E").End(xlUp).Row

For iCount = 1 To cNumRqd
    With wsFr.Range("G2:G" & wsFr.Cells(Rows.Count, "G").End(xlUp).Row)
        Set R = .Find(iCount, LookIn:=xlValues)
        If Not R Is Nothing Then
            sFirstAdd = R.Address
            Do
                iArrayPtr = iArrayPtr + 1
                If iArrayPtr > cNumRqd Then Exit For
                lRow = R.Row
                ReDim Preserve vTopOS(1 To cCols, 1 To iArrayPtr)
                For iCol = 1 To cCols
                    vTopOS(iCol, iArrayPtr) = wsFr.Cells(lRow, iCol).Value
                Next iCol
                Set R = .FindNext(R)
            Loop While Not R Is Nothing And R.Address <> sFirstAdd
        End If
    End With
Next iCount
wsTo.Range("A2:" & Cells(UBound(vTopOS, 2) + 1, cCols).Address) = WorksheetFunction.Transpose(vTopOS)

End Sub
 
Upvote 0

Forum statistics

Threads
1,196,329
Messages
6,014,681
Members
441,835
Latest member
rthomas268

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top