Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default display data based on a combobox

Hi

I have a table full with data (name, date, quantity, amount, etc...) on
sheet2

In sheet1, I have a combobox with all of the names on the table and I
need to know how to display automatically the data from sheet2 for only
the name I select from the combobox in sheet1.

I was thinking sending the value of the combobox to a cell and making a
vlookup for that value on sheet2, but I only get the first value.

Please help

Thanks

Daniel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default display data based on a combobox

Daniel,
One option is to use MATCH to find the name (and hence row) in
sheet2 and then read the data into an array

Assume data is in columns A to H with A containing name.

Dim Data as variant
Dim ws2 as worksheet

set ws2=worksheets("sheet2")

Myname=Worksheets("sheet1").range("a5") ' <=== your Combobox selection

row = Application.Match(MyName, ws2.Range("A:A"), 0)

If Not IsError(row) Then ' <==== match found

Data = ws2.Range("B" & row & ":H" & row) ' Read data into array

For r = LBound(Data, 1) To UBound(Data, 1)
For c = LBound(Data, 2) To UBound(Data, 2)
Debug.Print Data(r, c)
' ... Assign to cells in Sheet1
Next c
Next r
End If


HTH

" wrote:

Hi

I have a table full with data (name, date, quantity, amount, etc...) on
sheet2

In sheet1, I have a combobox with all of the names on the table and I
need to know how to display automatically the data from sheet2 for only
the name I select from the combobox in sheet1.

I was thinking sending the value of the combobox to a cell and making a
vlookup for that value on sheet2, but I only get the first value.

Please help

Thanks

Daniel


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
Display an Array of Data Based on Other Data golddave via OfficeKB.com Excel Worksheet Functions 4 September 17th 09 08:46 PM
Find criteria based data and display next to a count in another wk Blurt Excel Discussion (Misc queries) 2 July 22nd 09 11:30 PM
Display data from cells based on a formula JimmyB Excel Discussion (Misc queries) 0 May 27th 06 04:24 PM
How to display data in Combobox with no dups Oreg[_37_] Excel Programming 2 October 12th 05 06:53 PM
Having data populate text boxes based on Combobox Value Todd Huttenstine[_2_] Excel Programming 1 November 10th 03 01:35 AM


All times are GMT +1. The time now is 01:17 PM.

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"