Usuário com melhor resposta
ERROR 1004 VBA EXCEL

Pergunta
-
Olá pessoal,
Preciso de uma ajuda se possivel, estou com problemas no VBA eu gravei uma macro para adicionar formulas porém ela não funciona.
Segue abaixo em negrito a formula, alguem tem alguma sugestão para altera-lá?
Muito obrigado!
Hello Guys,
I am having problems with a code in VBA.
I Recorded a macro, but when I try to use I get the msg "Error 1004"
Thanks a lot!!!
Follow the code:
Application.CutCopyMode = False
Range("O10").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]=""B"",""Removed"",IF(RC[2]=""-"",""Need to confirm the buyer"",IF(RC[-2]=""G"",""NOH ok"",IF(RC[4]>=RC[-3],""NOH ok"",IF(RC[5]>=RC[-3],""Material at SLC"",IF(RC[7]>=RC[-3],""Material in transit"",IF(AND(RC[8]=""-"",RC[11]=""-""),""Place PO + ETA (Buyer)"",IF(AND(RC[8]>1,RC[11]=""-""),""Inform ETA (Buyer)"",IF(AND(RC[8]=""-"",RC[11]>1),""Place PO (Buyer)""" & _
"RC[8]>1,RC[11]>1),""ETA ok"",""ERROR""))))))))))"
Respostas
-
Tente algo como:
ActiveCell.FormulaR1C1 = "=IF(R[-12]C[-4]=""B"",""Removed"",IF(OR(R[-12]C=""-"", R[-12]C=""""),""Need to confirm the buyer"",IF(R[-12]C[-4]=""G"",""NOH ok"",IF(R[-12]C[2]>=R[-12]C[-5],""NOH ok"",IF(R[-12]C[3]>=R[-12]C[-5],""Material at SLC"",IF(R[-12]C[5]>=R[-12]C[-5],""Material in transit"",IF(AND(R[-12]C[6]=""-"",R[-12]C[9]=""-""),""Place PO + ETA (Buyer)"",IF(AND(R[-12]C[6]>1,R[-12]C[9]=""-""),""Inform ETA (Buyer)"",IF(AND(R[-12]C[6]=""-"",R[-12]C[9]>1),""Place PO (Buyer)"",IF(AND(R[-12]C[6]>1,R[-12]C[9]>1),""ETA ok"",""ERROR""))))))))))"
Felipe Costa Gualberto - http://www.ambienteoffice.com.br
- Sugerido como Resposta FilipeMagno sábado, 27 de julho de 2013 02:25
- Marcado como Resposta Hezequias VasconcelosModerator segunda-feira, 29 de julho de 2013 12:24
Todas as Respostas
-
-
Olá Felipe,
Primeiramente obrigado por sua ajuda, segue abaixo a formulá que preciso utilizar:
=IF(M10="B","Removed",IF(OR(Q10="-", Q10=""),"Need to confirm the buyer",IF(M10="G","NOH ok",IF(S10>=L10,"NOH ok",IF(T10>=L10,"Material at SLC",IF(V10>=L10,"Material in transit",IF(AND(W10="-",Z10="-"),"Place PO + ETA (Buyer)",IF(AND(W10>1,Z10="-"),"Inform ETA (Buyer)",IF(AND(W10="-",Z10>1),"Place PO (Buyer)",IF(AND(W10>1,Z10>1),"ETA ok","ERROR"))))))))))
Obrigado por sua ajuda!!
-
Tente algo como:
ActiveCell.FormulaR1C1 = "=IF(R[-12]C[-4]=""B"",""Removed"",IF(OR(R[-12]C=""-"", R[-12]C=""""),""Need to confirm the buyer"",IF(R[-12]C[-4]=""G"",""NOH ok"",IF(R[-12]C[2]>=R[-12]C[-5],""NOH ok"",IF(R[-12]C[3]>=R[-12]C[-5],""Material at SLC"",IF(R[-12]C[5]>=R[-12]C[-5],""Material in transit"",IF(AND(R[-12]C[6]=""-"",R[-12]C[9]=""-""),""Place PO + ETA (Buyer)"",IF(AND(R[-12]C[6]>1,R[-12]C[9]=""-""),""Inform ETA (Buyer)"",IF(AND(R[-12]C[6]=""-"",R[-12]C[9]>1),""Place PO (Buyer)"",IF(AND(R[-12]C[6]>1,R[-12]C[9]>1),""ETA ok"",""ERROR""))))))))))"
Felipe Costa Gualberto - http://www.ambienteoffice.com.br
- Sugerido como Resposta FilipeMagno sábado, 27 de julho de 2013 02:25
- Marcado como Resposta Hezequias VasconcelosModerator segunda-feira, 29 de julho de 2013 12:24
-