Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default populating one list/combobox based on the results of another

Hi,

I'd be grateful if someone could help with what i think is probably quite a
simple thing (just not as simple as me).

I have a userform with two comboboxes; the data for these come from one
data-table. combobox1 is filled with the table heading data (ie, from a
single row) and this works fine; what i can't do is populate the the second
combobox with the column of data in the data-table below the relevant header
(as chosen in the first combobox). i want the population to be programmatic
/ dynamic as the table is likely to change over time.

hope someone can help, cheers,

tim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default populating one list/combobox based on the results of another


"Tim" wrote in message
...
Hi,

I'd be grateful if someone could help with what i think is probably quite

a
simple thing (just not as simple as me).

I have a userform with two comboboxes; the data for these come from one
data-table. combobox1 is filled with the table heading data (ie, from a
single row) and this works fine; what i can't do is populate the the

second
combobox with the column of data in the data-table below the relevant

header
(as chosen in the first combobox). i want the population to be

programmatic
/ dynamic as the table is likely to change over time.

hope someone can help, cheers,

tim


apologies for replying to my own post - i've cobbled together something that
works (see below) - can anyone improve it, eg, i must be able to do it
without actually selecting cells? no worries if not, as i've got the thing
basically working now.

cheers

tim

Private Sub ComboBox1_AfterUpdate()

ComboBox2.Enabled = True
On Error Resume Next
Dim FindValue As String

FindValue = ComboBox1.Value
Application.Goto Reference:="rngsite"
Selection.Find(What:=FindValue, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
UserForm1.ComboBox2.Clear
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.Value = ""
UserForm1.ComboBox2.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
End Sub




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
Populating a data validation list based on criteria Ciarán Excel Discussion (Misc queries) 3 February 27th 09 08:03 AM
Populating other cells based on a choice from a drop-down list Ryan Excel Discussion (Misc queries) 1 December 19th 08 08:30 PM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Filter the results of a list based on a previous vlookup against the same list Mizpah Excel Worksheet Functions 2 August 18th 06 10:28 AM
Combobox populating based on Option Button Todd Huttenstine[_2_] Excel Programming 7 November 9th 03 10:18 PM


All times are GMT +1. The time now is 07:57 PM.

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"