Notifications
Clear all

Deixar código mais profissional

4 Posts
3 Usuários
0 Reactions
900 Visualizações
(@nilson1978)
Posts: 73
Trusted Member
Topic starter
 

Boa Noite
Fiz um codigo mas gostaria de deixar mais porfissional, pq tenho que dar continuidade ao mesmo
agradeceria de alguem me der uma luz

 
Postado : 13/04/2018 8:35 pm
(@klarc28)
Posts: 971
Prominent Member
 
Sub FILTRO()
'
' FILTRO Macro
'

'
    ActiveWindow.SmallScroll Down:=39
    Range("B51:K70").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-24
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
   ' Application.CutCopyMode = False
    Range("B27:K46").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
        "G7:G8"), CopyToRange:=Range("B51:K70"), Unique:=False
    ActiveWindow.SmallScroll Down:=24
    Range("B74:K93").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-21
    Range("B51").Select
    'Application.CutCopyMode = False
   ' Application.CutCopyMode = False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Range("I7:J8"), CopyToRange:=Range("B74:K93"), Unique:= _
        False
        Range("B100:K119").Select
    Selection.ClearContents
    Range("B100").Select
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    Application.CutCopyMode = False
    Range("B74:K93").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
        "Planilha1!Criteria"), CopyToRange:=Range("Planilha1!Extract"), Unique:= _
        False
    
End Sub

Sub Macro17()
'
' Macro17 Macro
'

'
    
Sub Macro19()
'
' Macro19 Macro
'

'
    ActiveWindow.SmallScroll Down:=30
    Range("B51:K70").Select
    Selection.ClearContents
    'Selection.ClearContents
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    Range("B27:K46").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
        "G7:G8"), CopyToRange:=Range("B51:K70"), Unique:=False
    ActiveWindow.SmallScroll Down:=12
    Range("B74:K93").Select
    Selection.ClearContents
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Range("I7:J8"), CopyToRange:=Range("B74:K93"), Unique:= _
        False
    'Application.CutCopyMode = False
   ' Application.CutCopyMode = False
   ' Application.CutCopyMode = False
    ActiveWindow.SmallScroll Down:=39
    Range("B100:K119").Select
    Selection.ClearContents
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    'Application.CutCopyMode = False
    Application.CutCopyMode = False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Range("L7:M8"), CopyToRange:=Range("B100:K119"), Unique:= _
        False
End Sub
 
Postado : 14/04/2018 5:16 am
(@mprudencio)
Posts: 2749
Famed Member
 

klarc28

Sinceramente nao entendi isso :?:

Eu apenas limpei seu codigo.

Sub FILTRO()

    Range("B51:K70").ClearContents
    Range("B74:K93").ClearContents
    Range("B100:K119").ClearContents
    Range("B27:K46").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("G7:G8"), _
    CopyToRange:=Range("B51:K70"), Unique:=False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("I7:J8"), _
    CopyToRange:=Range("B74:K93"), Unique:=False
    Range("B74:K93").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("Planilha1!Criteria"), _
    CopyToRange:=Range("Planilha1!Extract"), Unique:=False

End Sub


Sub Macro19()

    Range("B51:K70").ClearContents
    Range("B74:K93").ClearContents
    Range("B100:K119").ClearContents
    Range("B27:K46").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("G7:G8"), _
    CopyToRange:=Range("B51:K70"), Unique:=False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("I7:J8"), _
    CopyToRange:=Range("B74:K93"), Unique:=False
    Range("Planilha1!Extract").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("L7:M8"), _
    CopyToRange:=Range("B100:K119"), Unique:=False

End Sub

Marcelo Prudencio
Microsoft Excel Brasil no Facebook

"Começar já é a metade do caminho."
Autor Desconhecido

Simplifica que simples fica.
Nicole Tomazella.

"O Simples é Sempre Melhor Que o Complicado"
Jorge Paulo Lemann.

 
Postado : 14/04/2018 7:36 am
(@nilson1978)
Posts: 73
Trusted Member
Topic starter
 

Muitíssimo obrigado

 
Postado : 14/04/2018 11:22 am