Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a control box that has two options in the drop-down. I accomplished to have it so that once one of the options is selected; a list of the outputs is displayed in the excel spreadsheet. The problem is that when the other option within the drop down is selected theres no list output. I need it to generate a different output list for each option provided in the drop down. What i have as a code which spits out the list for one option is : Private Sub ComboBox1_Change() With Me.ComboBox1.TopLeftCell ..Offset(0, 5) = "NIN" ..Offset(0, 6) = "NOUT" ..Offset(0, 7) = "IND" ..Offset(0, 8) = "TITLE" ..Offset(0, 9) = "CASE" End With End Sub Any Help PLEASE ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
your combo box has 2 option but you only gave it one list of results. try something like this... Private Sub ComboBox1_Change() if me.combobox1.value = "value1" then With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With else With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "something" .Offset(0, 6) = "else" .Offset(0, 7) = "more" .Offset(0, 8) = "ofmy" .Offset(0, 9) = "stuff" End With End Sub tested in xp2003. works. at least on wendsdays. regards FSt1 "N.F" wrote: Hello, I have a control box that has two options in the drop-down. I accomplished to have it so that once one of the options is selected; a list of the outputs is displayed in the excel spreadsheet. The problem is that when the other option within the drop down is selected theres no list output. I need it to generate a different output list for each option provided in the drop down. What i have as a code which spits out the list for one option is : Private Sub ComboBox1_Change() With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With End Sub Any Help PLEASE ? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks alot for your help. I do get your idea but when I pasted it in try to
run it no list is generated in either option. Earlier it gave me an error that said something like: Block End Statement .... "FSt1" wrote: hi, your combo box has 2 option but you only gave it one list of results. try something like this... Private Sub ComboBox1_Change() if me.combobox1.value = "value1" then With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With else With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "something" .Offset(0, 6) = "else" .Offset(0, 7) = "more" .Offset(0, 8) = "ofmy" .Offset(0, 9) = "stuff" End With End Sub tested in xp2003. works. at least on wendsdays. regards FSt1 "N.F" wrote: Hello, I have a control box that has two options in the drop-down. I accomplished to have it so that once one of the options is selected; a list of the outputs is displayed in the excel spreadsheet. The problem is that when the other option within the drop down is selected theres no list output. I need it to generate a different output list for each option provided in the drop down. What i have as a code which spits out the list for one option is : Private Sub ComboBox1_Change() With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With End Sub Any Help PLEASE ? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Got it!. Thanks ALOT
It was simply missing a " End If " statement "N.F" wrote: Thanks alot for your help. I do get your idea but when I pasted it in try to run it no list is generated in either option. Earlier it gave me an error that said something like: Block End Statement .... "FSt1" wrote: hi, your combo box has 2 option but you only gave it one list of results. try something like this... Private Sub ComboBox1_Change() if me.combobox1.value = "value1" then With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With else With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "something" .Offset(0, 6) = "else" .Offset(0, 7) = "more" .Offset(0, 8) = "ofmy" .Offset(0, 9) = "stuff" End With End Sub tested in xp2003. works. at least on wendsdays. regards FSt1 "N.F" wrote: Hello, I have a control box that has two options in the drop-down. I accomplished to have it so that once one of the options is selected; a list of the outputs is displayed in the excel spreadsheet. The problem is that when the other option within the drop down is selected theres no list output. I need it to generate a different output list for each option provided in the drop down. What i have as a code which spits out the list for one option is : Private Sub ComboBox1_Change() With Me.ComboBox1.TopLeftCell .Offset(0, 5) = "NIN" .Offset(0, 6) = "NOUT" .Offset(0, 7) = "IND" .Offset(0, 8) = "TITLE" .Offset(0, 9) = "CASE" End With End Sub Any Help PLEASE ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Auto-populate cell based on selection of a list item | Excel Discussion (Misc queries) | |||
Combobox - can't get click event to run for first item in the list | Excel Programming | |||
combobox list item with superscript | Excel Programming | |||
Automated Delete Item from ComboBox List | Excel Programming | |||
Userform: Textbox changing with selection in combobox (list) | Excel Programming |