Filter issue with differently sized cells in Excel

drakar3 Posted messages 16 Status Membre -  
Theo.R Posted messages 585 Status Membre -
Hello everyone,

I've seen this question asked before and it seems to me that there is no solution, which is surprising for software like Excel.

I have created a ranking by team of 2 to 4 runners:
- each runner scores points for the team and the idea is to filter based on the team's total points.

So I want the filter to move all the cells of the team, which are obviously of different sizes. And of course, Excel tells me it's not possible!

So, I'm forced to enter a formula on the right to sort in ranking order and then cut and paste each team one by one into a new table... Is there really nothing better to do in 2016 with Excel????

Thanks in advance,

6 réponses

drakar3 Posted messages 16 Status Membre
 


Here is the file in question... :)
0
Vaucluse Posted messages 27336 Registration date   Status Contributeur Last intervention   6 453
 
Hello
what do you call cells of different sizes? If they are merged cells, the filter won't work!
But in this case, what compels you to merge them "of course"?

Looking forward to hearing from you

--
The quality of the answer mainly depends on the clarity of the question, thank you!
0
drakar3 Posted messages 16 Status Membre
 
On the attached image, there is a logo, then on the right the overall score (under points) and the names of the 4 runners followed by their respective scores... it should be possible to sort by the overall score only...
0
Theo.R Posted messages 585 Status Membre 31
 
Hello,

I think it's possible, but not through a "standard" solution pre-designed by Excel. I have a macro in mind that could be launched via a button to regenerate the ranking based on each team's points.

It's not a very complicated code in itself, but given the specifics of your request (cell sizes, etc.), I would prefer to have an Excel document from you and a precise request regarding what you expect before I dive into VBA :-)

In short:
- Please upload a basic document via www.cjoint.com
- Please list your SPECIFIC expectations (wishes, constraints, etc.). Especially think about how you will fill out your document. This will define how we should design the solution ;)

Best regards,
0
drakar3 Posted messages 16 Status Membre > Theo.R Posted messages 585 Status Membre
 
That's very kind of you.
I am attaching the document.
The principle is simple: after each event, points are awarded to runners.
These points feed into the total box.
The objective is then for the ranking to update, from the largest to the smallest number of points.
I am attaching the file. :)
Thank you very much in advance,
0
drakar3 Posted messages 16 Status Membre
 
Here is the link:
https://www.cjoint.com/c/FAspqTrS1ni

As you will see, not all teams have been created, and the total points are therefore in the 30 boxes located under "Pts".
0
drakar3 Posted messages 16 Status Membre
 
Last clarification: the total cell does not yet contain the updated formula but that is not important. The goal is to create the macro that will sort in descending order from these 30 totals, while respecting the order of the logos, team names, and concerned runners. Thank you, :)
0
Theo.R Posted messages 585 Status Membre 31
 
Will all the teams have the same number of lines? (and therefore the same number of runners?)
0
drakar3
 
Indeed, a maximum of 4 runners including 4 lines and 5 non-team members.
0
Theo.R Posted messages 585 Status Membre 31
 
Another question: I see in the attached document that there are several tables, should we keep them separate? Should there be only one classification or does each table constitute an independent classification?...
0
Theo.R Posted messages 585 Status Membre 31
 
Another question while waiting for the answer to the last one:

What do you want to do about teams that have the same score? Do we keep the tie and skip a place (so for two 1st ex-aequo we would have: 1st - 1st - 3rd ...) or something else?
0
drakar3 Posted messages 16 Status Membre
 
Hello Theo,

Actually, it doesn't quite fit:
- the idea is for the 30 teams to be ranked in descending order: 1st to 10th on the 1st page (league 1), 11th to 20th on the 2nd page (league 2), and 21st to 30th on the 3rd page (league 3).
- knowing that I have improved a few aspects of the documents.
- and that it is possible I will add one or two leagues in the future (so league 4 and league 5).

Does it seem possible for you to adapt your macro?
Thanks again :)

The document: https://www.cjoint.com/c/FAuqjgSh3fi
0
Theo.R Posted messages 585 Status Membre 31
 
Hello,

No worries about the response time, the only thing is that I currently don't have the time with my job to revisit my code and adapt it to your specifications.

But there's a good chance that I will have to start more or less from scratch, my code was specific to a situation with a precise operating procedure.

Anyway, I'm sorry but I won't be able to process your request for the moment, I hope that other macro enthusiasts will see this message and can take over ;)

Best of luck,

P.S.: If the topic falls into the depths of oblivion, feel free to close it and open a new one with a concise and complete description of your request ;)
0
Theo.R Posted messages 585 Status Membre 31
 
In the absence of further details on the request, below is the code that I was able to create.

Preliminary operation: - the sheet with the results must be named "RANKING"
- There must only be 10 teams (cells B6:B12 to B60:B64 in the example)
- In case of a tie score, the team that appears first in the list takes the higher place (may be unfair but oh well!)

Best of luck:

Sub Ranking()
Application.ScreenUpdating = False

For i = 6 To 60 Step 6
Range("B" & i).Value = WorksheetFunction.Rank(Range("E" & i).Value, Range("E:E"))
Next i

For j = 60 To 6 Step -6
If WorksheetFunction.CountIf(Range("B:B"), "=" & Range("B" & j).Value) = 1 Then
Else
Range("B" & j).Value = Range("B" & j).Value + 1
End If
Next j

Set Original = Sheets(2)
Original.Copy Before:=Sheets(2)
Set Copy = Sheets(2)

Original.Select
ActiveSheet.Pictures.Delete

For k = 6 To 60 Step 6

If Copy.Range("B" & k).Value = 1 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B6:B10").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 2 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B12:V16").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 3 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B18:V22").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 4 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B24:V28").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 5 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B30:V34").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 6 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B36:V40").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 7 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B42:V46").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 8 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B48:V52").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 9 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B54:V58").Select
ActiveSheet.Paste
End If

If Copy.Range("B" & k).Value = 10 Then
Copy.Select
Range("B" & k & ":V" & k + 4).Select
Selection.Copy
Sheets("RANKING").Select
Range("B60:V64").Select
ActiveSheet.Paste
End If

Next k
Application.CutCopyMode = False
Application.DisplayAlerts = False
Original.Range("B2").Select
Copy.Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True

Application.ScreenUpdating = True
End Sub
-1
drakar3
 
Hello Theo, sorry for the late reply but I didn't get a notification for your response... I will test this and keep you updated :)
0