Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you Lookup data on different worksheets

I have a worksheet that contains a cell that I enter in different
company names such as (Costco, Sams Club, Jack n the Box). Each of
these companys has a seperate worksheet with their addresses that I
want to lookup. My question is: Can you create a macro that takes the
name in the "Company" cell and uses that name to refer to the
appropriate worksheet? And from their can you then use a lookup
function to lookup the appropriate data.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do you Lookup data on different worksheets

Assume the worksheet for Costco is named Costco

if Costco is entered in A1, then

=if(A1<"",Indirect(A1&"!B9"),"")

would return the value found in cell B9 of the Sheet Costco

Similarly that technique could be used with a vlookup function

=if(Or(A1="",A2=""),"",Vlookup(A2,Indirect(A1&"!A2 :Z200"),3,False))

--
Regards,
Tom Ogilvy


"cvach" wrote in message
oups.com...
I have a worksheet that contains a cell that I enter in different
company names such as (Costco, Sams Club, Jack n the Box). Each of
these companys has a seperate worksheet with their addresses that I
want to lookup. My question is: Can you create a macro that takes the
name in the "Company" cell and uses that name to refer to the
appropriate worksheet? And from their can you then use a lookup
function to lookup the appropriate data.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How do you Lookup data on different worksheets

=IF(OR($B$3="",$A$8=""),"",VLOOKUP($A$8,INDIRECT($ B$3&"!A1:Z200"),2,FALSE))


This is the Formula that I have imputed into the cells I want looking
up information. This formula works perfectly with the Costco worksheet
but I recieved a #REF error when I try any other worksheet.

B3 contains the company name
A8 contains the location #

I also formated all of the customer worksheets the same with all of the
colums containing the same data type.

Any ideas?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do you Lookup data on different worksheets

If the sheet names have spaces in them you need this addition:

=IF(OR($B$3="",$A$8=""),"",VLOOKUP($A$8,INDIRECT(" '"&$B$3&"'!A1:Z200"),2,FAL
SE))

so that the sheet name will be included in single quotes. Note there were
additions on both sides of the $B$3 in the above.

--
Regards,
Tom Ogilvy


"cvach" wrote in message
oups.com...

=IF(OR($B$3="",$A$8=""),"",VLOOKUP($A$8,INDIRECT($ B$3&"!A1:Z200"),2,FALSE))


This is the Formula that I have imputed into the cells I want looking
up information. This formula works perfectly with the Costco worksheet
but I recieved a #REF error when I try any other worksheet.

B3 contains the company name
A8 contains the location #

I also formated all of the customer worksheets the same with all of the
colums containing the same data type.

Any ideas?



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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
How do I lookup data from multiple worksheets? Richard Excel Discussion (Misc queries) 2 April 6th 09 06:53 PM
lookup data across worksheets, one with 56K rows AlfNeuman Excel Worksheet Functions 4 December 10th 08 04:35 PM
Lookup Data Across Multiple Worksheets Lee4 Excel Discussion (Misc queries) 4 August 16th 08 10:07 PM
Combining data from worksheets - lookup? Connie Excel Discussion (Misc queries) 3 August 18th 05 07:46 PM


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