ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search with multiple results on different lines same column (https://www.excelbanter.com/excel-programming/399862-search-multiple-results-different-lines-same-column.html)

[email protected]

Search with multiple results on different lines same column
 
Please help me im lost :| I have a search button It should search
all of column A, the names are last names then first but some of
them might have the same last name.
how would i search the column a of the spreadsheet, post the results
into the listbox then be able to select from the listbox and load the
data from columns b d and f ?
I'm still very new to Programming so any help would be greatly
appreciated.


Dave Peterson

Search with multiple results on different lines same column
 
How about an alternative.

Apply Data|Filter|autofilter to column A (or the whole range).
Use the dropdown arrow to show the values you want and you'll see the other
data.

wrote:

Please help me im lost :| I have a search button It should search
all of column A, the names are last names then first but some of
them might have the same last name.
how would i search the column a of the spreadsheet, post the results
into the listbox then be able to select from the listbox and load the
data from columns b d and f ?
I'm still very new to Programming so any help would be greatly
appreciated.


--

Dave Peterson

[email protected]

Search with multiple results on different lines same column
 
On Oct 23, 1:58 pm, Dave Peterson wrote:
How about an alternative.

Apply Data|Filter|autofilter to column A (or the whole range).
Use the dropdown arrow to show the values you want and you'll see the other
data.

wrote:

Please help me im lost :| I have a search button It should search
all of column A, the names are last names then first but some of
them might have the same last name.
how would i search the column a of the spreadsheet, post the results
into the listbox then be able to select from the listbox and load the
data from columns b d and f ?
I'm still very new to Programming so any help would be greatly
appreciated.


--

Dave Peterson


The format for the names is last then first,
so i need the listbox or combo box to house the names, then when i
select the name it will load the data in the cells to the right, the
names have to stay in alphabetical order. i have 6 different forms so
its kind of a complicated situation this is the only part im having
trouble with. :(


dan dungan

Search with multiple results on different lines same column
 
I'm not clear how the name format forces you to need a listbox or
combobox.

Is the last name, first name format in one column?

Would it be useful to parse the name to two columns and name them
first name and last name?

Dan Dungan


The format for the names is last then first,
so i need the listbox or combo box to house the names, then when i
select the name it will load the data in the cells to the right, the
names have to stay in alphabetical order. i have 6 different forms so
its kind of a complicated situation this is the only part im having
trouble with. :(




[email protected]

Search with multiple results on different lines same column
 
On Oct 23, 3:14 pm, dan dungan wrote:
I'm not clear how the name format forces you to need a listbox or
combobox.

Is the last name, first name format in one column?

Would it be useful to parse the name to two columns and name them
first name and last name?

Dan Dungan





The format for the names is last then first,
so i need the listbox or combo box to house the names, then when i
select the name it will load the data in the cells to the right, the
names have to stay in alphabetical order. i have 6 different forms so
its kind of a complicated situation this is the only part im having
trouble with. :(- Hide quoted text -


- Show quoted text -


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?



All times are GMT +1. The time now is 02:40 PM.

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