Public Sub lsConsultaEstoque()
Sheets("Consulta Estoque").Unprotect
Application.ScreenUpdating = False
Worksheets("Consulta Estoque").Rows("10:500000").Select
Selection.Delete Shift:=xlUp
If Range("A3") = "Todos" Then
Worksheets("Registro de Inventário").Range("A1:J1048576").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("A8:J8"), Unique:=False
Else
Worksheets("Registro de Inventário").Range("A1:J1048576").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"A2:A3"), CopyToRange:=Range("A8:J8"), Unique:=False
End If
lsRedimensionarTabela
Application.ScreenUpdating = True
Sheets("Consulta Estoque").Protect
End Sub
Postado : 08/05/2015 5:55 am