If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro_AND function
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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 |
Thread Tools | |
Display Modes | |
|
|