Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All!
I have a problem with a ComboBox ListFill Range. I use this code fo the first ComboBox: Sheets("Start").Select x = Application.Match(Val(ComboBox2), Range("A2:A1002"), 0) If IsNumeric(x) Then ComboBox3 = Range("B2:B1002").Cells(x) 'ListFillRange End If ComboBox3 =cells(x), column("B") = Range("B2:B1002").Cells(x) vertical match. This one works ok. But: Then i want ComboBox4 to match: If cells(x)= ("A2") then ComboBox4= Row("2"), Columns ("L:Q"), = ("L2:Q2") .Cells(x) = horizontal match. I just can't make this one work. Suggestions? /Stromm -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stronma,
Have you tried ComboBox4 = Rows(2).Columns("L:Q").Cells(x) or ComboBox4 = Range("L2:Q2").Cells(x) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Stromma " wrote in message ... Hi All! I have a problem with a ComboBox ListFill Range. I use this code for the first ComboBox: Sheets("Start").Select x = Application.Match(Val(ComboBox2), Range("A2:A1002"), 0) If IsNumeric(x) Then ComboBox3 = Range("B2:B1002").Cells(x) 'ListFillRange End If ComboBox3 =cells(x), column("B") = Range("B2:B1002").Cells(x) = vertical match. This one works ok. But: Then i want ComboBox4 to match: If cells(x)= ("A2") then ComboBox4= Row("2"), Columns ("L:Q"), = ("L2:Q2") .Cells(x) = horizontal match. I just can't make this one work. Suggestions? /Stromma --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob
Thanks for your reply! Yes, i tried that without any luck... The problem is solved with a great deal of help from Andy Pope on th Ozgrid Forum: http://www.ozgrid.com/forum/ Here's the solution he provided: Private Sub ComboBox3_Change() If ComboBox3.ListIndex = 0 Then ComboBox2.ListIndex = ComboBox3.ListIndex MyFillCombo End If End Sub Private Sub MyFillCombo() Dim rngTemp As Range ComboBox5.Clear For Each rngTemp In Range("Start!L" & ComboBox3.ListIndex + 1 ":O" & ComboBox3.ListIndex + 1) ComboBox5.AddItem rngTemp.Value Next End Sub /Stromm -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
combobox value | Excel Discussion (Misc queries) | |||
COMBOBOX | Excel Programming | |||
combobox | Excel Programming | |||
combobox | Excel Programming |