ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro_AND function (https://www.excelbanter.com/excel-worksheet-functions/201202-macro_and-function.html)

Aline

Macro_AND function
 
There is an formula Id 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,


--
Aline

PCLIVE

Macro_AND function
 
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

--

"Aline" wrote in message
...
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,


--
Aline




Aline

Macro_AND function
 
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


--
Aline


"PCLIVE" wrote:

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

--

"Aline" wrote in message
...
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,


--
Aline






All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com