A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro_AND function



 
 
Thread Tools Display Modes
  #1  
Old September 3rd, 2008, 05:30 PM posted to microsoft.public.excel.worksheet.functions
Aline
external usenet poster
 
Posts: 41
Default 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  
Old September 3rd, 2008, 06:34 PM posted to microsoft.public.excel.worksheet.functions
PCLIVE
external usenet poster
 
Posts: 1,024
Default 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  
Old September 3rd, 2008, 06:46 PM posted to microsoft.public.excel.worksheet.functions
Aline
external usenet poster
 
Posts: 41
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.