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


Hi,

I've got a form with frames, text boxes, multipages and drop downs.
On one of the mulitpages, (page 1), I have two combo boxes, combo1 and
combo2.

Combo1 has main catergories:
Hardware
Software

I want combo2 to have results based on which option is selected from
combo1.

Combo2 if hardwa
PC
Monitor
Keyboard
Mouse
Telephone
Printer

Combo2 if softwa
Word
Excel
power point
outlook

[ F O N T = \ " A r i a l B l a c k \ " ] A n y c h a n c e t h
i s c a n b e d o n e ? [ / F O N T ]

I've tried for hardwa


Code:
--------------------
Private Sub txtsubcat_AfterUpdate()
If combo1.Value = "PC" Then
With txtsubcat
.AddItem ("PC Base Unit")
.AddItem ("Monitor")
.AddItem ("Keyboard")
.AddItem ("Mouse")
End With

End If
End Sub

--------------------


--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile: http://www.excelforum.com/member.php...o&userid=25960
View this thread: http://www.excelforum.com/showthread...hreadid=540346

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Dependant combo boxes

Create named ranges named "Hardware" and "Software" and then modify sample
code below:

Private Sub ComboBox1_Change()
ComboBox2.RowSource = ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "Hardware"
.AddItem "Software"
End With
End Sub


HTH

"harpscardiff" wrote:


Hi,

I've got a form with frames, text boxes, multipages and drop downs.
On one of the mulitpages, (page 1), I have two combo boxes, combo1 and
combo2.

Combo1 has main catergories:
Hardware
Software

I want combo2 to have results based on which option is selected from
combo1.

Combo2 if hardwa
PC
Monitor
Keyboard
Mouse
Telephone
Printer

Combo2 if softwa
Word
Excel
power point
outlook

[ F O N T = \ " A r i a l B l a c k \ " ] A n y c h a n c e t h
i s c a n b e d o n e ? [ / F O N T ]

I've tried for hardwa


Code:
--------------------
Private Sub txtsubcat_AfterUpdate()
If combo1.Value = "PC" Then
With txtsubcat
.AddItem ("PC Base Unit")
.AddItem ("Monitor")
.AddItem ("Keyboard")
.AddItem ("Mouse")
End With

End If
End Sub

--------------------


--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile: http://www.excelforum.com/member.php...o&userid=25960
View this thread: http://www.excelforum.com/showthread...hreadid=540346


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dependant combo boxes


Worked brilliantly!!

Thanks very much,


--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile: http://www.excelforum.com/member.php...o&userid=25960
View this thread: http://www.excelforum.com/showthread...hreadid=540346

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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Dependant Dropdown lists using Combo Boxes Lynda Excel Discussion (Misc queries) 15 October 17th 08 01:55 PM
Dependant lists using Combo Boxes Lynda Excel Discussion (Misc queries) 2 July 5th 08 03:46 PM
Help with Dependant list boxes haitch2 Excel Discussion (Misc queries) 4 October 17th 05 08:56 AM
second combo box will be dependant Noctos Excel Programming 4 December 29th 03 06:59 PM


All times are GMT +1. The time now is 08:56 AM.

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"