Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tudo que estiver relacionado ao Excel básico, como somar, calcular média, colocar bordas, etc.
  • Avatar do usuário
  • Avatar do usuário
#23913
Olá pessoal,

possuo uma planilha sequencial de 15 dezenas aleatórias e preciso realizar a classificação e ordenação dessas. Porém, ao selecionar o comando de CLASSIFICAR no excel o mesmo não realizar.

4 5 6 7 8 23 10 13 14 20 21 22 9 24 25
1 2 3 5 6 7 8 9 10 11 13 14 20 22 24
1 2 3 5 6 7 8 9 10 11 13 14 20 22 25
1 2 3 5 6 7 8 9 10 11 13 14 20 23 24
3 25 6 7 8 9 10 13 14 20 21 22 23 24 5
1 2 3 5 6 7 8 9 10 11 13 14 20 23 25

São muitas linhas, teria como fazer essa classificação/ordenação sem a duplicação da planilha caso ocorra a utilização da função menor.

Segue anexo o modelo. Obrigado.
Você não está autorizado a ver ou baixar esse anexo.
#23920
ruymds , Bom Dia.

Se entendi o que você quer, confere este modelo

Se minha resposta foi útil, clique em obrigado

Decio
Você não está autorizado a ver ou baixar esse anexo.
#23921
Veja se a solução do arquivo abaixo ajuda.
Você não está autorizado a ver ou baixar esse anexo.
#23925
uso de uma macro com array, bem rapida
http://www.comoganharnaloteria.com.br/f ... ent=279760

algo como essa que é facilmente ajustavel
Código: Selecionar todos
Sub Ordena_Seleção_decrescente()

     coluna_inicial = "b"
     coluna_final = "h"
     Linha_inicial = 6
     linha_final = 7

     Coluno = Range(coluna_inicial & Linha_inicial, coluna_final & linha_final).Value2
     Lfim = UBound(Coluno, 1): TCo = UBound(Coluno, 2)
     ci1 = 1   ' coluna inicial de dados da array

     For Lx = 1 To Lfim
          inC = ci1
          i = inC + 1
          Do
               a = Coluno(Lx, inC): b = Coluno(Lx, inC + 1)
               If a < b Then
                    Coluno(Lx, inC) = b: C = a
                    Coluno(Lx, inC + 1) = C
                    If inC > ci1 Then inC = inC - 1
               Else
                    inC = i: i = i + 1
               End If
          Loop Until inC = TCo
     Next

     '----------------------------------------------------------------------------------------------------
     Range(coluna_inicial & Linha_inicial, coluna_final & linha_final).Value2 = Coluno

End Sub
#23926
Então pessoal, agradeço pela dica mas não resolveu.

Seria algo assim

Matriz original:

4 5 6 7 8 23 10 13 14 20 21 22 9 24 25
1 2 3 5 6 7 8 9 10 11 13 14 20 22 24
1 2 3 5 6 7 8 9 10 11 13 14 20 22 25
1 2 3 5 6 7 8 9 10 11 13 14 20 23 24
3 25 6 7 8 9 10 13 14 20 21 22 23 24 5
1 2 3 5 6 7 8 9 10 11 13 14 20 23 25

Matriz Ordenada

1 2 3 5 6 7 8 9 10 11 13 14 20 22 24
1 2 3 5 6 7 8 9 10 11 13 14 20 22 25
1 2 3 5 6 7 8 9 10 11 13 14 20 23 24
1 2 3 5 6 7 8 9 10 11 13 14 20 23 25
3 5 6 7 8 9 10 13 14 20 21 22 23 24 25
4 5 6 7 8 9 10 13 14 20 21 22 23 24 25

Alguma outra alternativa?

Grato.
#23932
Código: Selecionar todos
Sub OrdenaLinhasV2()
 Dim k As Long
  For k = 1 To Cells(Rows.Count, 1).End(3).Row
   Cells(k, 1).Resize(, 15).Sort Key1:=Cells(k, 1), Order1:=xlAscending, Orientation:=xlLeftToRight
  Next k
    ActiveSheet.Sort.SortFields.Add Key:=Range("A1"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortTextAsNumbers
    With ActiveSheet.Sort
        .SetRange Range("A1:O" & Cells(Rows.Count, 1).End(xlUp).Row)
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord