Hi there,
I am trying to backup a formula with a VBA code, i have already tried many combinations but nothing works.
Could you help me, idk what i'm doing wrong ...
Just to context, the entire process is to replace the formula (linked to 3 different sheets) replacing the "#REF" caused by delete these sheets and import them again.
Formula:
=IF(IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&"_"&$G1;Padrao!$A:$E;5;FALSE))="MR";VLOOKUP($G1;Up_lw!$C:$E;3;FALSE);IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&"_"&$G1;Padrao!$A:$E;5;FALSE)))
if i try to use the code bellow, the VB returns an error as "Application-define or object-define error"
teste = "=IF(IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&'_'&$G1;Padrao!$A:$E;5;FALSE))='MR';VLOOKUP($G1;Up_lw!$C:$E;3;FALSE);IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&'_'&$G1;Padrao!$A:$E;5;FALSE)))"
Range("form_cluster_unico").Formula = Replace(teste, "'", Chr(34))
Regards
I am trying to backup a formula with a VBA code, i have already tried many combinations but nothing works.
Could you help me, idk what i'm doing wrong ...
Just to context, the entire process is to replace the formula (linked to 3 different sheets) replacing the "#REF" caused by delete these sheets and import them again.
Formula:
=IF(IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&"_"&$G1;Padrao!$A:$E;5;FALSE))="MR";VLOOKUP($G1;Up_lw!$C:$E;3;FALSE);IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&"_"&$G1;Padrao!$A:$E;5;FALSE)))
if i try to use the code bellow, the VB returns an error as "Application-define or object-define error"
teste = "=IF(IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&'_'&$G1;Padrao!$A:$E;5;FALSE))='MR';VLOOKUP($G1;Up_lw!$C:$E;3;FALSE);IF(OR(201501=$C1;201502=$C1;201503=$C1;201504=$C1;201505=$C1;201506=$C1;201507=$C1;201508=$C1;201509=$C1;201510=$C1;201511=$C1;201512=$C1;201601=$C1;201602=$C1;201603=$C1);VLOOKUP($G1;mar!$C:$E;3;FALSE);VLOOKUP($C1&'_'&$G1;Padrao!$A:$E;5;FALSE)))"
Range("form_cluster_unico").Formula = Replace(teste, "'", Chr(34))
Regards