Ir para conteúdo
Fórum Script Brasil

BMOTA

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre BMOTA

BMOTA's Achievements

0

Reputação

  1. BMOTA

    Executa Macro Automaticamente

    Bom dia, obrigado por responder Porém não deu certo.
  2. Estou tentando execultar a seguinte macro automaticamente mais não estou conseguindo.

    macro

     

    Private Sub Worksheet_Change(ByVal Target As Range)

            Application.EnableEvents = True

            If Not Intersect(Target, Range("H3")) Is Nothing Then

                    Call CLASSIFICAÇÃOCALCULORS

            End If

            Application.EnableEvents = False

       

    End Sub

     

    Sub CLASSIFICAÇÃOCALCULORS()

     Range("B2:F55").Select

        ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Clear

        ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Add Key:=Range( _

            "E2:E55"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _

            xlSortNormal

        ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Add Key:=Range( _

            "F2:F55"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _

            xlSortNormal

        With ActiveWorkbook.Worksheets("CALCULO RS").Sort

            .SetRange Range("B2:F55")

            .Header = xlGuess

            .MatchCase = False

            .Orientation = xlTopToBottom

            .SortMethod = xlPinYin

            .Apply

        End With

        ActiveWindow.SmallScroll Down:=-15

    End Sub

    Eu criei uma macro gravada que foi essa CLASSIFICAÇÃOCALCULORS e coloquei o codigo para que ele fosse execultada assim que as celulas h3 ou h2 fosse alteradas, por formulas.

  3. Estou tentando execultar a seguinte macro automaticamente mais não estou conseguindo. macro Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = True If Not Intersect(Target, Range("H3")) Is Nothing Then Call CLASSIFICAÇÃOCALCULORS End If Application.EnableEvents = False End Sub Sub CLASSIFICAÇÃOCALCULORS() Range("B2:F55").Select ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Clear ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Add Key:=Range( _ "E2:E55"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _ xlSortNormal ActiveWorkbook.Worksheets("CALCULO RS").Sort.SortFields.Add Key:=Range( _ "F2:F55"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("CALCULO RS").Sort .SetRange Range("B2:F55") .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With ActiveWindow.SmallScroll Down:=-15 End Sub Eu criei uma macro gravada que foi essa CLASSIFICAÇÃOCALCULORS e coloquei o codigo para que ele fosse execultada assim que as celulas h3 ou h2 fosse alteradas, por formulas.
×
×
  • Criar Novo...