PC Review


Reply
Thread Tools Rate Thread

Combo Box initial values question

 
 
teepee
Guest
Posts: n/a
 
      12th May 2007
Does anyone know how to make a combo box show a value when a sheet opens?
Mine are always blank when I open them until I select a value.

thanks

tp


 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      12th May 2007
Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0


---
Regards,
Norman


"teepee" <(E-Mail Removed)> wrote in message
news:4645ed29$(E-Mail Removed)...
> Does anyone know how to make a combo box show a value when a sheet opens?
> Mine are always blank when I open them until I select a value.
>
> thanks
>
> tp
>
>



 
Reply With Quote
 
teepee
Guest
Posts: n/a
 
      12th May 2007
thanks for trying.
says 'invalid use of me keyword.'

"Norman Jones" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0


---
Regards,
Norman


"teepee" <(E-Mail Removed)> wrote in message
news:4645ed29$(E-Mail Removed)...
> Does anyone know how to make a combo box show a value when a sheet opens?
> Mine are always blank when I open them until I select a value.
>
> thanks
>
> tp
>
>




 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      12th May 2007
Hi Teepee,

Where is your code?

I assumed that the combobox code would be either
in a userform module or a worksheet module, in which
case the keyword would not cause a problem and would
refer to the userform or the sheet holding the code.


---
Regards,
Norman


"teepee" <(E-Mail Removed)> wrote in message
news:4646132e$(E-Mail Removed)...
> thanks for trying.
> says 'invalid use of me keyword.'
>
> "Norman Jones" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> Hi Teepee,
>
> Try something like:
>
> Me.ComboBox1.ListIndex = 0
>
>
> ---
> Regards,
> Norman
>
>
> "teepee" <(E-Mail Removed)> wrote in message
> news:4645ed29$(E-Mail Removed)...
>> Does anyone know how to make a combo box show a value when a sheet
>> opens?
>> Mine are always blank when I open them until I select a value.
>>
>> thanks
>>
>> tp
>>
>>

>
>
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      12th May 2007
What kind of combobox is it?

A dropdown from the Forms toolbar--or a combobox from the Control toolbox
toolbar?

And where did you put the code?

teepee wrote:
>
> thanks for trying.
> says 'invalid use of me keyword.'
>
> "Norman Jones" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> Hi Teepee,
>
> Try something like:
>
> Me.ComboBox1.ListIndex = 0
>
> ---
> Regards,
> Norman
>
> "teepee" <(E-Mail Removed)> wrote in message
> news:4645ed29$(E-Mail Removed)...
> > Does anyone know how to make a combo box show a value when a sheet opens?
> > Mine are always blank when I open them until I select a value.
> >
> > thanks
> >
> > tp
> >
> >


--

Dave Peterson
 
Reply With Quote
 
teepee
Guest
Posts: n/a
 
      12th May 2007
Hi

It is a control toolbox comb box. I tried executing Norman's code on the
page - giving the error described above - and inside the box, where it just
did nothing.


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      12th May 2007
And you placed the code behind the worksheet--not in a general module, not in
the ThisWorkbook module?

You may want to share more of the code.

Did you put it in the worksheet_activate event or something else???

teepee wrote:
>
> Hi
>
> It is a control toolbox comb box. I tried executing Norman's code on the
> page - giving the error described above - and inside the box, where it just
> did nothing.


--

Dave Peterson
 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      12th May 2007
Hi Tepee,

The following code in ths worksheet module worked foe me:

'=============>>
Private Sub Worksheet_Activate()
With Me.ComboBox1
.ListFillRange = "A1: A10"
.ListIndex = 0
End With
End Sub
'<<=============



---
Regards,
Norman


"teepee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> It is a control toolbox comb box. I tried executing Norman's code on the
> page - giving the error described above - and inside the box, where it
> just
> did nothing.
>
>



 
Reply With Quote
 
teepee
Guest
Posts: n/a
 
      13th May 2007

"Norman Jones" <(E-Mail Removed)> wrote in message
news:O1M$(E-Mail Removed)...
Hi Tepee,

The following code in ths worksheet module worked foe me:

'=============>>
Private Sub Worksheet_Activate()
With Me.ComboBox1
.ListFillRange = "A1: A10"
.ListIndex = 0
End With
End Sub
'<<=============


many thanks norman - that worked a treat.


 
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
Combo Box initial values question teepee Microsoft Excel Programming 8 13th May 2007 12:57 AM
Combo Box initial values question teepee Microsoft Excel Misc 8 13th May 2007 12:57 AM
Combo box based on another combo but repeats initial input =?Utf-8?B?S29ycmVs?= Microsoft Access Forms 3 29th Jun 2006 04:17 PM
Unbound combo and initial values in fields =?Utf-8?B?TGlzYQ==?= Microsoft Access 2 30th Jan 2006 05:53 PM
Initial value in a combo box =?Utf-8?B?UGV0ZQ==?= Microsoft C# .NET 2 6th Apr 2005 05:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:47 PM.