#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rici


Hi,
If this formula
=(VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3),FALSE))
is converting as
"=(VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
then what will be the following
=IF(ISNA(VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3), FALSE)),"",VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3 ),FALSE))
I wanted to instert the line of code into a macro.
thanks and regards
nowfa

--
nowfa
-----------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000
View this thread: http://www.excelforum.com/showthread.php?threadid=40129

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Rici

Try:

Range("...").FormulaR1C1 =
"=IF(ISNA((VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))),"""",VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"

Regards

Trevor


"nowfal" wrote in
message ...

Hi,
If this formula
=(VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3),FALSE))
is converting as
"=(VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
then what will be the following
=IF(ISNA(VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3), FALSE)),"",VLOOKUP(J2,RATE!$A$1:C$20,IF(I2="P",2,3 ),FALSE))
I wanted to instert the line of code into a macro.
thanks and regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile:
http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=401299



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rici


Hi Trevor,
It is working, thank you very much.
with regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=401299

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Rici

You're very welcome; thanks for letting me know.

Regards


"nowfal" wrote in
message ...

Hi Trevor,
It is working, thank you very much.
with regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile:
http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=401299



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rici


Hi Trevor,
If I want to do the same in multiple cells what will b
the code.
Say it is now in L2 only, suppose I need in L2, R2, W2. Pls let me kno
the way.
thanks and regards
nowfa

--
nowfa
-----------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000
View this thread: http://www.excelforum.com/showthread.php?threadid=40129



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Rici

Couple of ways:

The first is just to put the same formula in each cell. The second is to
put it in L2 and then copy it to the others.

Sub Test()
Range("L2").FormulaR1C1 = _
"=IF(ISNA((VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))),"""",VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
Range("R2").FormulaR1C1 = _
"=IF(ISNA((VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))),"""",VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
Range("W2").FormulaR1C1 = _
"=IF(ISNA((VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))),"""",VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
End Sub

Sub Test2()
Range("L2").FormulaR1C1 = _
"=IF(ISNA((VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))),"""",VLOOKUP(RC[-2],RATE!R1C1:R20C[-9],IF(RC[-3]=""P"",2,3),FALSE))"
Range("L2").Copy Range("R2")
Range("L2").Copy Range("W2")
End Sub

Regards

Trevor


"nowfal" wrote in
message ...

Hi Trevor,
If I want to do the same in multiple cells what will be
the code.
Say it is now in L2 only, suppose I need in L2, R2, W2. Pls let me know
the way.
thanks and regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile:
http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=401299



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"