Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VLookup or other?

I'm not sure if VLookup is the process I'm looking for, but if it is, I
can't figure out a way to get it to work. My scenario is this:

I have information listed in 3 columns: Name, Address, Phone. I want to
use a UserForm to search these columns and display the info.

If a user searches via column A (Name) and it matches, the results show the
address and phone. If the user searches via column B (Address) and it
matches, the results show Name and Phone, as well. Same goes if the user
searches column C for Phone.

Can someone help me or direct me in the right direction to accomplish this
task? Any help would be truly appreciated.

Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VLookup or other?

How about an alternative?

Select those three columns and do:
Data|Filter|autofilter

Then you can use those arrows to show the rows that meet your criteria.

Data|Filter|show all

To see everything.

Bruise wrote:

I'm not sure if VLookup is the process I'm looking for, but if it is, I
can't figure out a way to get it to work. My scenario is this:

I have information listed in 3 columns: Name, Address, Phone. I want to
use a UserForm to search these columns and display the info.

If a user searches via column A (Name) and it matches, the results show the
address and phone. If the user searches via column B (Address) and it
matches, the results show Name and Phone, as well. Same goes if the user
searches column C for Phone.

Can someone help me or direct me in the right direction to accomplish this
task? Any help would be truly appreciated.

Mark


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default VLookup or other?

You could use the find function...

dim wks as worksheet
dim rngToSearch as range
dim rngFound as range

set wks = sheets("Sheet1")
set rngtosearch = wks.range("A:C")

set rngfound = rngtosearch.find(What:="Bruise", LookAt:=xlPart)
if rngfound is nothing then
msgbox "Not Found"
else
msgbox wks.cells(rngfound.row, 1)
msgbox wks.cells(rngfound.row, 2)
msgbox wks.cells(rngfound.row, 3)
end if
--
HTH...

Jim Thomlinson


"Bruise" wrote:

I'm not sure if VLookup is the process I'm looking for, but if it is, I
can't figure out a way to get it to work. My scenario is this:

I have information listed in 3 columns: Name, Address, Phone. I want to
use a UserForm to search these columns and display the info.

If a user searches via column A (Name) and it matches, the results show the
address and phone. If the user searches via column B (Address) and it
matches, the results show Name and Phone, as well. Same goes if the user
searches column C for Phone.

Can someone help me or direct me in the right direction to accomplish this
task? Any help would be truly appreciated.

Mark



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default VLookup or other?

Hi Mark

It is possible using vlookup. But its bit complicated.. . and if you
want the answer here it is.

Let's assume that ur table is in sheet1 in first 3 columns. You need
to add two more columns to this; Just copy Columns A and B to columns D
and E. This is to enable all 3 vlookups.
In sheet2 say you want to enter of your search items in cells a2, b2,
and c2 for Name, Address, and Phone respectively. Enter the following
formulas in respective cells:

A3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,1,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,3,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,2,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,2,0)),(VLOOKUP(B2,She et1!B:E,3,0))),(VLOOKUP(A2,Sheet1!A:E,1,0)))

B3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,2,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,1,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,3,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,3,0)),(VLOOKUP(B2,She et1!B:E,1,0))),(VLOOKUP(A2,Sheet1!A:E,2,0)))

C3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,3,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,2,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,1,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,1,0)),(VLOOKUP(B2,She et1!B:E,2,0))),(VLOOKUP(A2,Sheet1!A:E,3,0)))

Now enter your search item in cell a2, b2, c2 as the case may be and if
there is a matching result it will come up in cells a3, b3 and c3.

Cells A1:C1 are for headings.

Thanks
Karthik Bhat

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VLookup or other?

Thank you, Karthik. This worked perfectly. I was hoping to use it in a
UserForm setting with VBA code, but this worked just as well.

Thank you for the assistance.

Mark


"Karthik Bhat - Bangalore" wrote in message
ups.com...
Hi Mark

It is possible using vlookup. But its bit complicated.. . and if you
want the answer here it is.

Let's assume that ur table is in sheet1 in first 3 columns. You need
to add two more columns to this; Just copy Columns A and B to columns D
and E. This is to enable all 3 vlookups.
In sheet2 say you want to enter of your search items in cells a2, b2,
and c2 for Name, Address, and Phone respectively. Enter the following
formulas in respective cells:

A3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,1,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,3,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,2,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,2,0)),(VLOOKUP(B2,She et1!B:E,3,0))),(VLOOKUP(A2,Sheet1!A:E,1,0)))

B3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,2,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,1,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,3,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,3,0)),(VLOOKUP(B2,She et1!B:E,1,0))),(VLOOKUP(A2,Sheet1!A:E,2,0)))

C3
=IF(ISNA(VLOOKUP(A2,Sheet1!A:E,3,0)),IF(ISNA(VLOOK UP(B2,Sheet1!B:E,2,0)),IF(ISNA(VLOOKUP(C2,Sheet1!C :E,1,0)),"Not
Found",VLOOKUP(C2,Sheet1!C:E,1,0)),(VLOOKUP(B2,She et1!B:E,2,0))),(VLOOKUP(A2,Sheet1!A:E,3,0)))

Now enter your search item in cell a2, b2, c2 as the case may be and if
there is a matching result it will come up in cells a3, b3 and c3.

Cells A1:C1 are for headings.

Thanks
Karthik Bhat



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
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
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 11:10 AM.

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"