ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching a database in excel (https://www.excelbanter.com/excel-programming/331365-searching-database-excel.html)

kylev96[_2_]

Searching a database in excel
 

I have attached a simple database search for excel. What it does is
searches a list of questions and answers in Sheet2 and returns matching
results in a listbox in a userform.

It works fine, however I'd like to change it to do the following:
instead of only being able to searhc the question, I'd like it to
search both the question and the answer, but still only return the
question in listbox 1 and the answer in textbox2.

Here's an example:

If the data is as follows (in Sheet 2, different columns):

Q: Who is playing in the NBA finals?

A: The Detroit Pistons and the San Antonio Spurs.

I'd like search querys entered such as: NBA, NBA Finals, Detroit
Pistons, Spurs, etc. all to return just "Who is playing in the NBA
finals" under search results, upon clicking they will recieve the
answer under "answer". I'm trying to allow cusomters to search for any
topic/phrase, and few FAQ's on them.. May sound confusing, but it's
probably a simple range modification, I just can't figure it
out...thanks and I appreciate it!


+-------------------------------------------------------------------+
|Filename: simple search form.ZIP |
|Download: http://www.excelforum.com/attachment.php?postid=3470 |
+-------------------------------------------------------------------+

--
kylev96
------------------------------------------------------------------------
kylev96's Profile: http://www.excelforum.com/member.php...o&userid=23983
View this thread: http://www.excelforum.com/showthread...hreadid=377810


STEVE BELL

Searching a database in excel
 
Search the archives for "Find". There have been many replies on using this
is VBA.

--
steveB

Remove "AYN" from email to respond
"kylev96" wrote in
message ...

I have attached a simple database search for excel. What it does is
searches a list of questions and answers in Sheet2 and returns matching
results in a listbox in a userform.

It works fine, however I'd like to change it to do the following:
instead of only being able to searhc the question, I'd like it to
search both the question and the answer, but still only return the
question in listbox 1 and the answer in textbox2.

Here's an example:

If the data is as follows (in Sheet 2, different columns):

Q: Who is playing in the NBA finals?

A: The Detroit Pistons and the San Antonio Spurs.

I'd like search querys entered such as: NBA, NBA Finals, Detroit
Pistons, Spurs, etc. all to return just "Who is playing in the NBA
finals" under search results, upon clicking they will recieve the
answer under "answer". I'm trying to allow cusomters to search for any
topic/phrase, and few FAQ's on them.. May sound confusing, but it's
probably a simple range modification, I just can't figure it
out...thanks and I appreciate it!


+-------------------------------------------------------------------+
|Filename: simple search form.ZIP |
|Download: http://www.excelforum.com/attachment.php?postid=3470 |
+-------------------------------------------------------------------+

--
kylev96
------------------------------------------------------------------------
kylev96's Profile:
http://www.excelforum.com/member.php...o&userid=23983
View this thread: http://www.excelforum.com/showthread...hreadid=377810




STEVE BELL

Searching a database in excel
 
Try the Find function in your code.

You might also look at InStr or Like

--
steveB

Remove "AYN" from email to respond
"kylev96" wrote in
message ...

I have attached a simple database search for excel. What it does is
searches a list of questions and answers in Sheet2 and returns matching
results in a listbox in a userform.

It works fine, however I'd like to change it to do the following:
instead of only being able to searhc the question, I'd like it to
search both the question and the answer, but still only return the
question in listbox 1 and the answer in textbox2.

Here's an example:

If the data is as follows (in Sheet 2, different columns):

Q: Who is playing in the NBA finals?

A: The Detroit Pistons and the San Antonio Spurs.

I'd like search querys entered such as: NBA, NBA Finals, Detroit
Pistons, Spurs, etc. all to return just "Who is playing in the NBA
finals" under search results, upon clicking they will recieve the
answer under "answer". I'm trying to allow cusomters to search for any
topic/phrase, and few FAQ's on them.. May sound confusing, but it's
probably a simple range modification, I just can't figure it
out...thanks and I appreciate it!


+-------------------------------------------------------------------+
|Filename: simple search form.ZIP |
|Download: http://www.excelforum.com/attachment.php?postid=3470 |
+-------------------------------------------------------------------+

--
kylev96
------------------------------------------------------------------------
kylev96's Profile:
http://www.excelforum.com/member.php...o&userid=23983
View this thread: http://www.excelforum.com/showthread...hreadid=377810





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com