Boa noite, Srs.
Depois que quebrar a cabeça consegui fazer uma POG, que atendeu a minha necessidade de imediato, caso os senhores tenhas outras sugestões postem aqui!
Sub Transpor()
Dim Count As Integer
Count = 2
SheetData1.Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
SheetData3.Select
SheetData3.Range("A2").Select
ActiveSheet.Paste
While Not IsEmpty(SheetData3.Range("A" & Count))
SheetData3.Range("B" & Count).Value = "=IFERROR(VLOOKUP(C[-1],Plan1!C[1]:C[8],4,0),"""")"
SheetData3.Range("C" & Count).Value = "=IFERROR(VLOOKUP(C[-2],Plan1!C:C[7],5,0),"""")"
SheetData3.Range("D" & Count).Value = "=IF(IFERROR(VLOOKUP(C[-3],Plan1!C[-1]:C,2,0),"""") = 1, IFERROR(VLOOKUP(C[-3],Plan1!C[-1]:C,2,0),""""),"""")"
SheetData3.Range("E" & Count).Value = "=IF(SUMIFS(Plan1!C[4],Plan1!C[-2],Plan3!C[-4],Plan1!C[-1],Plan3!C[-1]) = 0,"""",SUMIFS(Plan1!C[4],Plan1!C[-2],Plan3!C[-4],Plan1!C[-1],Plan3!C[-1]))"
SheetData3.Range("F" & Count).Value = "=IF(SUMIFS(Plan1!C[4],Plan1!C[-3],Plan3!C[-5],Plan1!C[-2],Plan3!C[-2]) = 0,"""",SUMIFS(Plan1!C[4],Plan1!C[-3],Plan3!C[-5],Plan1!C[-2],Plan3!C[-2]))"
SheetData3.Range("G" & Count).Value = "=IF(IFERROR(VLOOKUP(C[-6],Plan1!C[-4]:C[-3],2,0),"""") = 2, IFERROR(VLOOKUP(C[-6],Plan1!C[-4]:C[-3],2,0),""""),"""")"
SheetData3.Range("H" & Count).Value = "=IF(SUMIFS(Plan1!C[1],Plan1!C[-5],Plan3!C[-7],Plan1!C[-4],Plan3!C[-1]) = 0,"""",SUMIFS(Plan1!C[1],Plan1!C[-5],Plan3!C[-7],Plan1!C[-4],Plan3!C[-1]))"
SheetData3.Range("I" & Count).Value = "=IF(SUMIFS(Plan1!C[1],Plan1!C[-6],Plan3!C[-8],Plan1!C[-5],Plan3!C[-2]) = 0,"""",SUMIFS(Plan1!C[1],Plan1!C[-6],Plan3!C[-8],Plan1!C[-5],Plan3!C[-2]))"
Count = Count + 1
Wend
SheetData3.Range("A2").Select
SheetData3.Range(Selection, Selection.End(xlToRight)).Select
SheetData3.Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
SheetData3.Range("A1").Select
End Sub
Se a resposta foi útil! Clique na mãozinha ao lado do botão Citar.
Sua dúvida foi respondida? Marque como RESOLVIDO em seus tópicos, usando o botão com marca verde.
Postado : 05/05/2015 9:21 pm