R
Riccardo Pucher Prencis
The code that I am trying to use is very simple.
I would like to replicare automatically a formula along many cells, one yes
and one no along a given range.
So I tried to build a macro:
sub a ()
for i 4 to 400 step 2
range(i).formula="=if(a2<b2;a2;b2)
next i
end sub
The macro doesn't work even without the for-next cicle.
On the contrary, the formula =if(a2<b2;a2;b2) works as expected when placed
in a cell of the worksheet inside which I want to run the macro.
What am I doing wrong?
Thank you for your help,
Riccardo
I would like to replicare automatically a formula along many cells, one yes
and one no along a given range.
So I tried to build a macro:
sub a ()
for i 4 to 400 step 2
range(i).formula="=if(a2<b2;a2;b2)
next i
end sub
The macro doesn't work even without the for-next cicle.
On the contrary, the formula =if(a2<b2;a2;b2) works as expected when placed
in a cell of the worksheet inside which I want to run the macro.
What am I doing wrong?
Thank you for your help,
Riccardo