#1   Report Post  
Posted to microsoft.public.excel.programming
Faz Faz is offline
external usenet poster
 
Posts: 8
Default Vlookup

I have the following statement on an excel spreadsheet. Please help me to
convert this to either a macro or vba code, the latter preferably.

=IF($A2-(VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,1))<1,IF(ISERROR(VLOOKUP($A2,'L II 200 raw
data'!$A2:$D$65000,4)),NA(),VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,4)),NA())

Thanks
Faz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Vlookup

Range("F3").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-1]C1-(VLOOKUP(R[-1]C1,'LII 200 raw " & Chr(10) &
"data'!R[-1]C1:R65000C4,1))<1,IF(ISERROR(VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA(),VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA())"


"Faz" wrote:

I have the following statement on an excel spreadsheet. Please help me to
convert this to either a macro or vba code, the latter preferably.

=IF($A2-(VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,1))<1,IF(ISERROR(VLOOKUP($A2,'L II 200 raw
data'!$A2:$D$65000,4)),NA(),VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,4)),NA())

Thanks
Faz

  #3   Report Post  
Posted to microsoft.public.excel.programming
Faz Faz is offline
external usenet poster
 
Posts: 8
Default Vlookup

Thank you for your help. What is chr(10)?
Faz

"dmoney" wrote:

Range("F3").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-1]C1-(VLOOKUP(R[-1]C1,'LII 200 raw " & Chr(10) &
"data'!R[-1]C1:R65000C4,1))<1,IF(ISERROR(VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA(),VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA())"


"Faz" wrote:

I have the following statement on an excel spreadsheet. Please help me to
convert this to either a macro or vba code, the latter preferably.

=IF($A2-(VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,1))<1,IF(ISERROR(VLOOKUP($A2,'L II 200 raw
data'!$A2:$D$65000,4)),NA(),VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,4)),NA())

Thanks
Faz

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Vlookup

Chr(10) is an in-cell linefeed. Not sure why it was used in this case but
no harm, no foul

BTW...............a macro is written in VBA code so it is not a case of
either/or


Gord Dibben MS Excel MVP

On Sun, 10 Aug 2008 07:14:01 -0700, Faz
wrote:

Thank you for your help. What is chr(10)?
Faz

"dmoney" wrote:

Range("F3").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-1]C1-(VLOOKUP(R[-1]C1,'LII 200 raw " & Chr(10) &
"data'!R[-1]C1:R65000C4,1))<1,IF(ISERROR(VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA(),VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA())"


"Faz" wrote:

I have the following statement on an excel spreadsheet. Please help me to
convert this to either a macro or vba code, the latter preferably.

=IF($A2-(VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,1))<1,IF(ISERROR(VLOOKUP($A2,'L II 200 raw
data'!$A2:$D$65000,4)),NA(),VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,4)),NA())

Thanks
Faz


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vlookup

Just to add to what Gord wrote...

This character is used in the name of the worksheet. This seems pretty odd to
me.

If the name of the sheet is really "LII 200 raw " & chr(10) & "data", then the
user will see a square box in the worksheet tab. It really won't force a
linefeed in the tab.



Faz wrote:

Thank you for your help. What is chr(10)?
Faz

"dmoney" wrote:

Range("F3").Select
ActiveCell.FormulaR1C1 = _
"=IF(R[-1]C1-(VLOOKUP(R[-1]C1,'LII 200 raw " & Chr(10) &
"data'!R[-1]C1:R65000C4,1))<1,IF(ISERROR(VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA(),VLOOKUP(R[-1]C1,'LII 200 raw " &
Chr(10) & "data'!R[-1]C1:R65000C4,4)),NA())"


"Faz" wrote:

I have the following statement on an excel spreadsheet. Please help me to
convert this to either a macro or vba code, the latter preferably.

=IF($A2-(VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,1))<1,IF(ISERROR(VLOOKUP($A2,'L II 200 raw
data'!$A2:$D$65000,4)),NA(),VLOOKUP($A2,'LII 200 raw
data'!$A2:$D$65000,4)),NA())

Thanks
Faz


--

Dave Peterson
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
using a vlookup to enter text into rows beneath the vlookup cell Roger on Excel Excel Programming 1 November 29th 07 12:09 PM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Which is faster: VLOOKUP-worksheet or VB-array VLOOKUP? erikhs[_20_] Excel Programming 1 August 6th 06 06:18 PM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 07:08 PM.

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

About Us

"It's about Microsoft Excel"