Ola
estava tentando colar uma formula SE, ja existente em uma Macro
mas quando tente aplicar a macro me retorna o seguinte:
Erro em tempo de execução '1004':
Erro de definição de aplicativo ou definiçõa de objeto
O Codigo:
Sub ZSD043()
'
' ZSD043 Macro
'
'
Range("O2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-10],'D:Plamilha ExcelPlanilha de IGUALDADES[Todas.xlsx]Plan1'!R2C1:R15000C2,2,0),"""")"
Range("O2").Select
Range("P2").Select
Range("P2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],ZMM014!R5C2:R80000C5,4,0),IF(RC[-1]="""","""",IFERROR(VLOOKUP(RC[-1],ZMM014!R5C2:R80000C5,4,0),""PN não Cadastrado"")))"
Range("P3").Select
Range("Q2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-12],ZMM014!R5C2:R80000C5,4,0),""0"")"
Range("Q3").Select
Range("R2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-17],'MB52'!R5C2:R15000C7,6,0),"""")"
Range("R3").Select
Range("S2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(IF(ISERROR(RC[-2]),""PN não Cadastrado"",IF(AND(RC[-1]=RC[-12],RC[-1]<>""""),""Qtde. Bloqueada"",IF(AND(RC[-1]>RC[-12],RC[-1]<>""""),""Erro de Bloq."",IF(AND(RC[-1]<RC[-12],RC[-1]<>"""",RC[-1]<>0),""Bloq. Parcial"",IF(AND(RC[-2]>=RC[-12],RC[-2]<>""0""),""Disp. Imediato"",IF(AND(RC[-3]>=RC[-12],RC[-3]<>""PN não Cadastrado"",RC[-3]<>""""),""Dispo. Igualdade""" & _
"(RC[-18],Prazos!R5C2:R3689C3,2,0))))))),IF(AND(RC[-2]>0,RC[-2]<RC[-12]),""Saldo Parcial"",""Indisponivel""))"
Range("S3").Select
Range("O2:S2").Select
Selection.AutoFill Destination:=Range("O2:R4000")
Range("O2:R4000").Select
Range("T2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-15],ZMM014!R5C2:R5C6,5,0)"
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-15],ZMM014!R5C2:R5C6,5,0)"
Range("T3").Select
ActiveWindow.SmallScroll ToRight:=3
Range("T2").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub
Espero que alguem possa me ajudar
Postado : 30/08/2012 8:21 am