Boa tarde!!
Tente essa gambiarra
Option Explicit
Sub AleVBA_17812()
Dim lastrow As Long
'lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
Worksheets("-10%").Cells.Delete
With Worksheets("Extremos")
.Activate
.AutoFilterMode = False
[A1].Value = "AleVBA"
[B1].Value = "AleVBA1"
[C1].Value = "AleVBA2"
With Range("C2")
.Formula = "=IF(COUNTA(A:A)*10%,IF(ROW(A1)>COUNTA(A:A)*10%,9,1))&IF(COUNTA(A:A)*90%,IF(ROW(A1)>COUNTA(A:A)*90%,9,2))"
With .Resize(Range("A" & Rows.Count).End(xlUp).Row - 1)
.FillDown
.Copy
.PasteSpecial xlPasteValues
End With
End With
lastrow = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("$A$1:$C$" & lastrow).AutoFilter Field:=3, Criteria1:=Array("92"), Operator:=xlFilterValues
.Range("A2:C" & lastrow).Copy Sheets("-10%").Range("A1")
End With
Application.CutCopyMode = False
With Worksheets("-10%")
.Activate
Range("A1:C1").EntireColumn.AutoFit
End With
Application.ScreenUpdating = True
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 23/10/2015 2:05 pm