Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Combo Box initial values question

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


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combo Box initial values question

Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0


---
Regards,
Norman


"teepee" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Combo Box initial values question

thanks for trying.
says 'invalid use of me keyword.'

"Norman Jones" wrote in message
...
Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0


---
Regards,
Norman


"teepee" wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combo Box initial values question

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" wrote in message
...
thanks for trying.
says 'invalid use of me keyword.'

"Norman Jones" wrote in message
...
Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0


---
Regards,
Norman


"teepee" wrote in message
...
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







  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Combo Box initial values question

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" wrote in message
...
Hi Teepee,

Try something like:

Me.ComboBox1.ListIndex = 0

---
Regards,
Norman

"teepee" wrote in message
...
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


  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Combo Box initial values question

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.


  #7   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Combo Box initial values question

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
  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combo Box initial values question

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" wrote in message
...
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.




  #9   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Combo Box initial values question


"Norman Jones" wrote in message
...
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
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
Combo Box initial values question teepee Excel Discussion (Misc queries) 8 May 13th 07 12:57 AM
What gets XNPV to calculate correctly if initial values are zero? Jim McCartney Excel Worksheet Functions 1 July 21st 06 04:37 AM
Combo box values based on other combo box value JCanyoneer Excel Programming 1 April 5th 05 06:41 PM
Combo Box initial set up AJ Master[_2_] Excel Programming 10 August 17th 04 11:57 PM
registering the cell values of excel combo box associated values john_stevens Excel Programming 1 May 21st 04 09:39 PM


All times are GMT +1. The time now is 07:38 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"