Macro_AND function

A

Aline

There is an formula I’d like to add it in a macro.
=IF(AND(L3="Y", M3="Y", N3="Y"), "Y", "N")

I want it to automatically fill up for the rest of row. Similar another
function that was already added in the macro:

Formula:
=IF(OR(E3="B", E3="C", E3="E"), "Y", "N")

In the macro:
..Range("L3:L" & LastRow).Formula _
= "=IF(E3=""B"", ""Y"", IF(OR(E3=""C""," _
& "E3=""E""), ""Y"", ""N""))"


Any suggestion?

Thanks,
 
P

PCLIVE

You should apply the formula to one cell first, then copy it (assuming you
want the refernces to increment).

Range("L3").Formula _
= "=IF(E3=""B"", ""Y"", IF(OR(E3=""C""," _
& "E3=""E""), ""Y"", ""N""))"

Range("L3").copy
range("L4:L" & LastRow).select
activesheet.paste

HTH,
Paul
 
A

Aline

Hi,

The formula is working great for the following (OR FUNCTION):
..Range("L3:L" & LastRow).Formula _
= "=IF(E3=""B"", ""Y"", IF(OR(E3=""C""," _
& "E3=""E""), ""Y"", ""N""))"

I am having difficult to apply the same concept for AND FUNCTION:
=IF(AND(L3="Y", M3="Y", N3="Y"), "Y", "N") in the marco.

Thanks,
Aline
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top