Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Modify Macro To LookUp 2 Tables

I am using this code:

ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[9],refman,2,FALSE)"
Selection.Copy

I need to break up the table "refman" into 2 tables. Is it possible to have
the vlookup check both tables ( say refman1 and refman2) ?

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Modify Macro To LookUp 2 Tables

The formula gets a bit ugly.

=if(countif(refman1, RC[9])0,
vlookup(RC[9],refman1,2,false),if(countif(refman2, RC[9])0,
vlookup(RC[9],refman2,2,false),"Not Found"))

Or something close to that...
--
HTH...

Jim Thomlinson


"carl" wrote:

I am using this code:

ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[9],refman,2,FALSE)"
Selection.Copy

I need to break up the table "refman" into 2 tables. Is it possible to have
the vlookup check both tables ( say refman1 and refman2) ?

Thank you in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Modify Macro To LookUp 2 Tables

Thank you Jim. I tried placing this code and received a Compiler Error /
Syntax.

Here's the code I used:

ActiveCell.FormulaR1C1 = "=if(countif(refman1; RC[9])0; "
vlookup(RC[9];refman1;2;false);if(countif(refman2; RC[9])0;
vlookup(RC[9];refman2;2;false);"Not Found"))
"

"Jim Thomlinson" wrote:

The formula gets a bit ugly.

=if(countif(refman1, RC[9])0,
vlookup(RC[9],refman1,2,false),if(countif(refman2, RC[9])0,
vlookup(RC[9],refman2,2,false),"Not Found"))

Or something close to that...
--
HTH...

Jim Thomlinson


"carl" wrote:

I am using this code:

ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[9],refman,2,FALSE)"
Selection.Copy

I need to break up the table "refman" into 2 tables. Is it possible to have
the vlookup check both tables ( say refman1 and refman2) ?

Thank you in advance.

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
I need to modify my macro ... Dr. Darrell Excel Discussion (Misc queries) 0 February 24th 10 07:21 PM
Modify A Macro carl Excel Worksheet Functions 1 September 27th 07 08:39 PM
Modify a Macro Carl Excel Worksheet Functions 1 October 28th 06 10:32 AM
Modify a macro Philippe Jacquet Excel Programming 0 January 4th 06 08:45 AM
Help to modify macro please Brian Tozer Excel Programming 2 December 28th 03 08:24 PM


All times are GMT +1. The time now is 11:41 AM.

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"