Moderatori: Anthony47, Flash30005
Function SortUnici(ByRef myRan As Range) As Variant
Dim wArr(), wInd As Long, tArr(1 To 2)
Dim I As Long, J As Long
'
ReDim wArr(1 To myRan.Rows.Count, 1 To 2)
For I = 1 To myRan.Rows.Count
If myRan.Cells(I, 1) <> "" Then
If Application.WorksheetFunction.CountIf(myRan.Cells(1, 1).Resize(I, 1), myRan.Cells(I, 1).Value) = 1 Then
wInd = wInd + 1
wArr(wInd, 1) = myRan.Cells(I, 1).Value
wArr(wInd, 2) = Application.WorksheetFunction.MaxIfs(myRan.Cells(1, 2).Resize(myRan.Rows.Count), myRan.Cells(1, 1).Resize(myRan.Rows.Count), myRan.Cells(I, 1).Value)
End If
End If
Next I
'bubble sort:
For I = 1 To wInd - 1
For J = I + 1 To wInd
If wArr(I, 2) < wArr(J, 2) Then
tArr(2) = wArr(I, 2)
tArr(1) = wArr(I, 1)
wArr(I, 2) = wArr(J, 2)
wArr(I, 1) = wArr(J, 1)
wArr(J, 2) = tArr(2)
wArr(J, 1) = tArr(1)
End If
Next J
Next I
'Fill Empty
For I = wInd + 1 To UBound(wArr)
wArr(I, 1) = ""
wArr(I, 2) = ""
Next I
SortUnici = wArr
End Function
=SortUnici(R14:S40)
=SE(CONTA.SE(R$13:R14;R14)=1;R14;"")
=MAX.PIÙ.SE($S$14:$S$35;$R$14:$R$35;U14)+RIF.RIGA()/100000
=INDICE($U$14:$U$35;CONFRONTA(GRANDE($V$14:$V$35;RIF.RIGA(A1));$V$14:$V$35;0))
=SE(AB4<>"";INT(CERCA.VERT(W14;U14:V35;2;0));"")
Te l'avevo detto che con formule servivano un paio di colonne di appoggio...Ciao Anthony grazie è pò lunga (RISOLTO)
Torna a Applicazioni Office Windows
Ordinare colonne sulla stessa riga se stesso contenuto Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 10 |
Mettere tutto MAIUSCOLO un range di celle Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 7 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Trasformare celle con formattazioni in html Autore: servicedynergy |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 7 ospiti