PC Review


Reply
Thread Tools Rate Thread

Combobox item selection+pop up list

 
 
=?Utf-8?B?Ti5G?=
Guest
Posts: n/a
 
      13th Jun 2007
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 With Quote
 
 
 
 
=?Utf-8?B?RlN0MQ==?=
Guest
Posts: n/a
 
      13th Jun 2007
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 With Quote
 
=?Utf-8?B?Ti5G?=
Guest
Posts: n/a
 
      13th Jun 2007
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 With Quote
 
=?Utf-8?B?Ti5G?=
Guest
Posts: n/a
 
      13th Jun 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Item To ComboBox List Minitman Microsoft Excel Programming 7 3rd Sep 2008 01:10 AM
list selection for a combobox kevcar40 Microsoft Access 0 12th Apr 2006 08:16 AM
Combobox Item selection hangs the application. =?Utf-8?B?RGViaQ==?= Microsoft ADO .NET 1 27th Jan 2005 06:43 AM
Re: Can't populate combobox list with 1 item Steph Microsoft Excel Programming 1 11th Aug 2004 10:11 PM
Re: Can't populate combobox list with 1 item Steph Microsoft Excel Programming 0 11th Aug 2004 10:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 AM.