Hi,

I have written an IF Statement in a cell "A1", that looks at "G6" and if the cell value equals 21.9, then it gets a value from "Y20" the formula is:

=IF(G6=21.9,Y20,IF(H6=21.9,Z20,IF(I6=21.9,AA20,IF(J6=21.9,AB20))))
can this be written in VBA/

any help will be appreciated.

regards

Derek