Boa tarde!!
me desculpa mas não deu tempo de ajustar, tenho que ir trabalhar.
Sub AindaFaltaTerminareAjustar()
Dim lr As Long
Const sFormula1 As String = "=INDIRECT(ADDRESS(1,MOD(ROW($A2)-2,$P$1)+5,1,1,$O$1))"
Const sFormula2 As String = "=YEAR(A2)"
Const sFormula3 As String = "=VLOOKUP(MONTH(A2),$L$1:$M$12,2,FALSE)"
Const sFormula4 As String = "=INDIRECT(ADDRESS(INT((ROW($A2)-2)/$P$1)+2,1,1,1,$O$1))"
Const sFormula5 As String = "=INDIRECT(ADDRESS(INT((ROW($A2)-2)/$P$1)+2,3,1,1,$O$1))"
Const sFormula6 As String = "=INDIRECT(ADDRESS(INT((ROW($A2)-2)/$P$1)+2,4,1,1,$O$1))"
Const sFormula7 As String = "=INDIRECT(ADDRESS(INT((ROW($A2)-2)/$P$1)+2,MOD(ROW($A2)-2,$P$1)+5,1,1,$O$1))"
With Sheets("Dinâmica")
lr = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Range("A2").Resize(lr).Formula = sFormula1
.Range("B2").Resize(lr).Formula = sFormula2
.Range("C2").Resize(lr).Formula = sFormula3
.Range("D2").Resize(lr).Formula = sFormula4
.Range("E2").Resize(lr).Formula = sFormula5
.Range("F2").Resize(lr).Formula = sFormula6
.Range("G2").Resize(lr).Formula = sFormula7
.Range("H2").Resize(lr).Formula = sFormula8
.Range("H2").Resize(lr, 9).Value = .Range("H2").Resize(lr, 9).Value
End With
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 11/04/2013 9:50 am