Sub media()
Dim i As Integer Dim soma As Double Dim media As Double
soma = 0 i = 1
Do Until IsEmpty(Range("A" & i))
soma = soma + Range("A" & i) i = i + 1
Loop
media = soma / (i - 1) Range("B1") = media
End Sub
Sub filtrar()
With ActiveSheet.ListObjects("Tabela1").Range .AutoFilter Field:=1, Criteria1:="Valor1" .AutoFilter Field:=2, Criteria1:="Valor2" .AutoFilter Field:=3, Criteria1:="Valor3" .AutoFilter Field:=4, Criteria1:="Valor4" .AutoFilter Field:=5, Criteria1:="Valor5" End With
End Sub
Sub linhabranco()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 2 Step -1 Rows(i).EntireRow.Insert Next i
End Sub
Sub copiarplanilha()
Dim wb As Workbook Set wb = Workbooks.Add
ThisWorkbook.Sheets("Planilha1").Copy Before:=wb.Sheets(1) wb.Sheets(1).Name = "Nova Planilha"
End Sub
Sub destacarduplicatas()
Dim rng As Range
Set rng = ActiveSheet.Range("A1:A10")
rng.FormatConditions.AddUniqueValues rng.FormatConditions(rng.FormatConditions.Count).SetFirstPriority rng.FormatConditions(1).DupeUnique = xlDuplicate rng.FormatConditions(1).Font.Color = -16776961 rng.FormatConditions(1).Interior.Color = -983040
End Sub