#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default List Boxes

I am creating a report with a listbox. The listbox contains doctors names
and when you click on a doctors names i want the label boxes and textboxes
on the page that give more inforamtion about the selected person to change.
Can anyone tell me how to do this or give me a good website about listboxes
and also comboboxes.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default List Boxes

Have a table with the doctors names in column 1, then the other details in
column 2, 3, etc.

Then when you click on the listbox, take the selected value, do a VLOOKUP
into the table to extract the other details, and load the labels and
textboxes with that data.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RC" wrote in message
...
I am creating a report with a listbox. The listbox contains doctors names
and when you click on a doctors names i want the label boxes and textboxes
on the page that give more inforamtion about the selected person to

change.
Can anyone tell me how to do this or give me a good website about

listboxes
and also comboboxes.
Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default List Boxes

Cound you give me an example of the code on how to do the vlookup?
"RC" wrote in message
...
I am creating a report with a listbox. The listbox contains doctors names
and when you click on a doctors names i want the label boxes and textboxes
on the page that give more inforamtion about the selected person to

change.
Can anyone tell me how to do this or give me a good website about

listboxes
and also comboboxes.
Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List Boxes


Could you give me an example of what that code would look like bob? I
am not very good with listboxs, nor lookup, first time using either in
an excel application


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default List Boxes

Okay, set-up a table in H1:K10 say like so

Dr Jones GP Merseyside Part-Time
Dr Peters GP Manchester Full-Time
Mr Walters Consultant Bootle Full-Time

Load the list box with the names (you can set the Rowsource property to
H1:H10). Then on the userform the listbox click event would lock something
like

Private Sub ListBox1_Click()
With Me.ListBox1
Label1.Caption = WorksheetFunction.VLookup(.Value, Range("H1:K10"),
2, False)
TextBox1.Text = WorksheetFunction.VLookup(.Value, Range("H1:K10"),
3, False)
End With
End Sub

This gets the 2nd column (e.g. GP) to the label, and the 3rd (area) to the
textbox.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Have a table with the doctors names in column 1, then the other details

in
column 2, 3, etc.

Then when you click on the listbox, take the selected value, do a VLOOKUP
into the table to extract the other details, and load the labels and
textboxes with that data.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RC" wrote in message
...
I am creating a report with a listbox. The listbox contains doctors

names
and when you click on a doctors names i want the label boxes and

textboxes
on the page that give more inforamtion about the selected person to

change.
Can anyone tell me how to do this or give me a good website about

listboxes
and also comboboxes.
Thanks






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
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
Questions on combo boxes and list boxes. Marc New Users to Excel 1 March 14th 06 09:40 AM
List boxes/combo boxes Tibow Excel Programming 3 February 17th 04 12:35 PM
List Boxes (Help!) Haas[_2_] Excel Programming 2 November 26th 03 10:54 PM
List boxes nath Excel Programming 1 October 10th 03 01:33 AM


All times are GMT +1. The time now is 06:25 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"