Search Spreadsheet add to list

G

gwoodby

I could do it in some sort of drop down box, the form can only be
modified from the user forms, so i cant use the
Data|Filter|autofilter to column A due partially because some of
the people whom have access to it could change things that dont need
to be changed. As for the Splitting the columns i Could do that but
then i would have to modfiy the still growing 14 pages of code :|
so
im trying to figure out the easiest way to do this. I was using

Dim r As Range
Dim ws As Worksheet
Dim SearchTxt As String
Set ws = Worksheets("sheet1")
SearchTxt = TxtCaseName.Text
Set r = ws.Cells.Find(What:=SearchTxt, After:=ws.Range("A1"), _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)


to search, but how would i make it to where I could Post the Results
into a listbox or combo box, or some kind of drop down menu and then
when you choose the selection ( the specific name you wanted) That
it
will pull up the data on the same row column b, d, f etc
im thinking maybe declare a variable store them there and
use .additem?
 
T

Tom Ogilvy

yes, additem would put the list in a combobox or listbox.

If you store the locations in a variable, you could then get a head start so
to speak using that variable to determine where to get them. Othewise, you
would duplicate the search code and rebuild the list of locations, probably
using Union to store which rows to copy in a range reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top