Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DOV DOV is offline
external usenet poster
 
Posts: 4
Default combo box or list

Hello,

I am a very beginner in Macros for excel.

We have an excersize: to buildings, A bilding and B building, A have tenants
from A1 to A16 and B building have B1 to B8, how can I do alist Box or combo
box so the user can choose building and then apartment number. Thank you, Dov
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default combo box or list

You will need 3 lists and 2 listboxes. In column A list the building letters
(A & B), column B list the A apartment numbers, column C the B apartment
numbers. Create listbox1 from the Control Toolbox. Select it's properties
and make the ListFillRange A1:A2. From the same Control toolbox make a
listbox2. Do nothing to it. Select listbox1, right-click and select View
Code. It should display a code window with
Private Sub ListBox1_Click() already there. Put the following code to make
it look like this:

Private Sub ListBox1_Click()
If ListBox1.Value = "A" Then
ListBox2.ListFillRange = "B1:B16"
Else
ListBox2.ListFillRange = "C1:C8"
End If
End Sub

Close the code window, click the little triangle button to get out of design
mode to activate your listboxes.
Mike F
"dov" wrote in message
...
Hello,

I am a very beginner in Macros for excel.

We have an excersize: to buildings, A bilding and B building, A have
tenants
from A1 to A16 and B building have B1 to B8, how can I do alist Box or
combo
box so the user can choose building and then apartment number. Thank you,
Dov



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
Combo box list help Michelle Excel Discussion (Misc queries) 2 January 10th 08 09:26 PM
List box or Combo box?? Jock Excel Discussion (Misc queries) 1 September 17th 07 02:06 PM
Combo Box List aftamath Excel Discussion (Misc queries) 2 October 5th 05 08:39 PM
Combo box Add To List Hank[_2_] Excel Programming 0 September 21st 04 12:49 PM
Combo Box Value List Todd[_7_] Excel Programming 1 September 17th 03 02:49 AM


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