
BMOTA
-
Total de itens
2 -
Registro em
-
Última visita
BMOTA's Achievements
0
Reputação
-
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.