Bom dia!!
Seria isso?
Sub AleVBA_17808()
Dim InputRange As Range
Dim OutputCell As Range
Application.ScreenUpdating = False
Set InputRange = Sheets("Plan1").Range("I15:M23")
Set OutputCell = Sheets("Plan1").Range("O2")
ActiveSheet.Range("O:O").ClearContents
[O1].Value = "AleVBA"
For Each cll In InputRange
OutputCell.Value = cll.Value
Set OutputCell = OutputCell.Offset(1, 0)
Next
ActiveSheet.[O1].CurrentRegion.RemoveDuplicates Columns:=1, Header:=xlYes
ActiveSheet.[O2].CurrentRegion.Sort Key1:=Range("O2"), Order1:=xlAscending, Header:=xlGuess
Call PartII
ActiveSheet.Range("O:O").ClearContents
Application.ScreenUpdating = True
End Sub
Sub PartII()
With ActiveSheet
.Range("Q15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A1),$O$2:$O$50,0),1),"""")"
.Range("Q15").AutoFill .Range("Q15:Q24")
.Range("S15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A11),$O$2:$O$50,0),1),"""")"
.Range("S15").AutoFill .Range("S15:S24")
.Range("U15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A21),$O$2:$O$50,0),1),"""")"
.Range("U15").AutoFill .Range("U15:U24")
.Range("W15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A31),$O$2:$O$50,0),1),"""")"
.Range("W15").AutoFill .Range("W15:W24")
.Range("Y15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A41),$O$2:$O$50,0),1),"""")"
.Range("Y15").AutoFill .Range("Y15:Y24")
.Range("AA15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A51),$O$2:$O$50,0),1),"""")"
.Range("AA15").AutoFill .Range("AA15:AA24")
.Range("AC15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A61),$O$2:$O$50,0),1),"""")"
.Range("AC15").AutoFill .Range("AC15:AC24")
.Range("AE15").Formula = "=IFERROR(INDEX($O$2:$O$50,MATCH(ROW(A71),$O$2:$O$50,0),1),"""")"
.Range("AE15").AutoFill .Range("AE15:AE24")
.Range("Q15:AE24").Value = .Range("Q15:AE24").Value
'Classifica
[Q15:Q24].Sort Key1:=[Q14], Order1:=xlAscending
[S15:S24].Sort Key1:=[S14], Order1:=xlAscending
[U15:U24].Sort Key1:=[U14], Order1:=xlAscending
[W15:W24].Sort Key1:=[W14], Order1:=xlAscending
[Y15:Y24].Sort Key1:=[Y14], Order1:=xlAscending
[AA15:AA24].Sort Key1:=[AA14], Order1:=xlAscending
[AC15:AC24].Sort Key1:=[AC14], Order1:=xlAscending
[AE15:AE24].Sort Key1:=[AE14], Order1:=xlAscending
End With
End Sub
Att
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 27/10/2015 8:07 am