BigMax Posted May 12, 2019 Share Posted May 12, 2019 Por favor, quem puder me ajudar na ordenação da linha 40 e 41 ( Onde está o erro?) Sub Macro1() ' ' Macro1 Macro ' ' ActiveWorkbook.Worksheets("Montagem").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Montagem").Sort.SortFields.Add Key:=Range("S40:AQ40"), _ SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Montagem").Sort .SetRange Range("S40:AQ41") .Header = xlGuess .MatchCase = False .Orientation = xlLeftToRight .SortMethod = xlPinYin .Apply End With End Sub veja imagem anexa Quote Link to comment Share on other sites More sharing options...
dois Posted May 13, 2019 Share Posted May 13, 2019 SE entendi que quer ordenar somente o Range(S41:AQ541)... basta alterar: DE: Key:=Range("S40:AQ40") PARA: Key:=Range("S41:AQ41") Lembrando que você não está utilizando ordenação para o Range("S40:AQ40") , caso queira precisará incluir uma 2a. Key. 1 Quote Link to comment Share on other sites More sharing options...
BigMax Posted May 13, 2019 Author Share Posted May 13, 2019 3 minutos atrás, dois disse: SE entendi que quer ordenar o Range(S41:AQ541)... basta alterar: DE: Key:=Range("S40:AQ40") PARA: Key:=Range("S41:AQ41") Lembrando que você não está utilizando ordenação para o Range("S40:AQ40") , caso queira precisará incluir uma 2a. Key. Obrigado! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.