Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default IF ISERROR with index match

I am using the following code to find a value in one workbook and return it
to another workbook based on a match between two cells:

Range("I1").Select
ActiveCell.FormulaR1C1 = _

"=INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1],bloombergsymbols.xlsm!C10,0))"

I would like to add to the code that IF an error is returned to enter the
value from the H1 cell from the active workbook. Is this possible? I've
tried many different scenarios but I keep getting an object defined error.
Any help is appreciated. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default IF ISERROR with index match

You mean H1 from the activeworksheet???


Dim myFormula as string
myFormula = "INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1]," _
& "bloombergsymbols.xlsm!C10,0))"
range("i1").formular1c1 _
= "=if(iserror(" & myformula & "),h1," & myformula & ")"

Untested, uncompiled.




aileen wrote:

I am using the following code to find a value in one workbook and return it
to another workbook based on a match between two cells:

Range("I1").Select
ActiveCell.FormulaR1C1 = _

"=INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1],bloombergsymbols.xlsm!C10,0))"

I would like to add to the code that IF an error is returned to enter the
value from the H1 cell from the active workbook. Is this possible? I've
tried many different scenarios but I keep getting an object defined error.
Any help is appreciated. Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default IF ISERROR with index match

Thanks for the help.

"Dave Peterson" wrote:

You mean H1 from the activeworksheet???


Dim myFormula as string
myFormula = "INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1]," _
& "bloombergsymbols.xlsm!C10,0))"
range("i1").formular1c1 _
= "=if(iserror(" & myformula & "),h1," & myformula & ")"

Untested, uncompiled.




aileen wrote:

I am using the following code to find a value in one workbook and return it
to another workbook based on a match between two cells:

Range("I1").Select
ActiveCell.FormulaR1C1 = _

"=INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1],bloombergsymbols.xlsm!C10,0))"

I would like to add to the code that IF an error is returned to enter the
value from the H1 cell from the active workbook. Is this possible? I've
tried many different scenarios but I keep getting an object defined error.
Any help is appreciated. Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default IF ISERROR with index match

H1 should be in R1C1 reference style.

Dim myFormula as string
myFormula = "INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1]," _
& "bloombergsymbols.xlsm!C10,0))"
range("i1").formular1c1 _
= "=if(iserror(" & myformula & "),r1c8," & myformula & ")"



aileen wrote:

Thanks for the help.

"Dave Peterson" wrote:

You mean H1 from the activeworksheet???


Dim myFormula as string
myFormula = "INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1]," _
& "bloombergsymbols.xlsm!C10,0))"
range("i1").formular1c1 _
= "=if(iserror(" & myformula & "),h1," & myformula & ")"

Untested, uncompiled.




aileen wrote:

I am using the following code to find a value in one workbook and return it
to another workbook based on a match between two cells:

Range("I1").Select
ActiveCell.FormulaR1C1 = _

"=INDEX(bloombergsymbols.xlsm!C6,MATCH(RC[-1],bloombergsymbols.xlsm!C10,0))"

I would like to add to the code that IF an error is returned to enter the
value from the H1 cell from the active workbook. Is this possible? I've
tried many different scenarios but I keep getting an object defined error.
Any help is appreciated. Thanks


--

Dave Peterson


--

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
ISERROR and INDEX Funcion question Flipper Excel Worksheet Functions 8 March 29th 10 09:29 PM
iserror, index & if Sueellen1312 Excel Worksheet Functions 4 February 16th 10 05:13 PM
ISERROR,SMALL,INDEX, MATCH, SMALL?? M.A.Tyler Excel Discussion (Misc queries) 1 May 2nd 07 04:08 AM
IsError and Match function GDCross Excel Programming 7 May 26th 06 07:49 PM
IF(ISERROR(MATCH - need value where match was found Ed[_9_] Excel Programming 2 November 12th 03 09:02 PM


All times are GMT +1. The time now is 04:10 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"