Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Search Results to Listbox

Please Help if you can
Column A has last name, first name
Say these names are in Column A
Column A Row
Hoover, John 6
Hoover, Rick 10
Hoover, Jordan 20

Does the Search, all 3 should come up in the list box/ComboBox/
Dropdown
Wichever is easiest,
When i select Rick, It should select Rown 10 Column A Then get the
Data From Row B10
D10, and F10

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Search Results to Listbox

It would make things a lot easier if you put the last name in one column and
the first name in another. Although, it can be done with it as it is, the
code is a lot less complicated if the two elements are separated.

" wrote:

Please Help if you can
Column A has last name, first name
Say these names are in Column A
Column A Row
Hoover, John 6
Hoover, Rick 10
Hoover, Jordan 20

Does the Search, all 3 should come up in the list box/ComboBox/
Dropdown
Wichever is easiest,
When i select Rick, It should select Rown 10 Column A Then get the
Data From Row B10
D10, and F10


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Search Results to Listbox

After reading this again, it really is not necessart to separate them. I had
read it that you wanted to search for the name with "Rick", but you want to
select from a list box or combo box.

1. Use column A to load the list or combo box.
2. In the click event of the control, use the Find method to search Range
A2 through the last row with data.
3. When found, use the offset method to capture the cells B, D and F on the
same row into a variable.
4. Use the variable to do whatever you need to do with the data.

" wrote:

Please Help if you can
Column A has last name, first name
Say these names are in Column A
Column A Row
Hoover, John 6
Hoover, Rick 10
Hoover, Jordan 20

Does the Search, all 3 should come up in the list box/ComboBox/
Dropdown
Wichever is easiest,
When i select Rick, It should select Rown 10 Column A Then get the
Data From Row B10
D10, and F10


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Search Results to Listbox

On Oct 24, 5:15 am, JLGWhiz wrote:
After reading this again, it really is not necessart to separate them. I had
read it that you wanted to search for the name with "Rick", but you want to
select from a list box or combo box.

1. Use column A to load the list or combo box.
2. In the click event of the control, use the Find method to search Range
A2 through the last row with data.
3. When found, use the offset method to capture the cells B, D and F on the
same row into a variable.
4. Use the variable to do whatever you need to do with the data.



" wrote:
Please Help if you can
Column A has last name, first name
Say these names are in Column A
Column A Row
Hoover, John 6
Hoover, Rick 10
Hoover, Jordan 20


Does the Search, all 3 should come up in the list box/ComboBox/
Dropdown
Wichever is easiest,
When i select Rick, It should select Rown 10 Column A Then get the
Data From Row B10
D10, and F10- Hide quoted text -


- Show quoted text -



Hi

I will do it the foloowing way.

1) Define a range in module like this

Public rng_Levels As Range


2) Initialise it in "This Workbook" the following way.. edit the
worksheet to urs.

Private Sub Workbook_Open()

With ThisWorkbook.Worksheets("Levels")
Set rng_Levels = .Range("A2:B20")
End With

End Sub

3) Add the items to a listbox (named Listbox1)

n_Col = 1
n_Row = 2

Do While rng_Levels(n_Row, n_Col).Value < ""
Listbox1.additem rng_Levels(n_Row, n_Col).Value
n_Row = n_Row + 1
Loop


once it is selected, write to a specific cell and use VLookup to
retieve its correcponding data.

Try it..
HTH
Joe

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
Copying Named Ranges based on ListBox Results VBA_Newbie79 Excel Programming 1 June 29th 07 06:36 PM
VBA code to search and display results in multicolumn listbox [email protected] Excel Programming 6 February 7th 07 01:32 AM
Search Spreadsheet - Results in either listbox or new spreadsheet Brandon Johnson Excel Programming 1 June 7th 06 03:19 PM
I cant do a search on this forum. Everytime I search, it comes up with zero results viswanthank Excel Programming 3 June 10th 05 09:15 AM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 03:21 AM.

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"