#1   Report Post  
aftamath
 
Posts: n/a
Default Combo Box List

This is the code I have for a combo box,

Private Sub ComboBox1_GotFocus()

With ComboBox1
.Text = "Select Dimension"
.AddItem "Weight"
.AddItem "Flange Thickness"
.AddItem "OAL"
.AddItem "Body Length"
.AddItem "Counter Bore"
End With

End Sub

For some reason, the drop down menu lists these five options seven times
over. I'm new to VBA, why is this.
  #2   Report Post  
Chip Pearson
 
Posts: n/a
Default

You probably want to Clear the combobox before adding items to
it.

.Clear


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"aftamath" wrote in message
...
This is the code I have for a combo box,

Private Sub ComboBox1_GotFocus()

With ComboBox1
.Text = "Select Dimension"
.AddItem "Weight"
.AddItem "Flange Thickness"
.AddItem "OAL"
.AddItem "Body Length"
.AddItem "Counter Bore"
End With

End Sub

For some reason, the drop down menu lists these five options
seven times
over. I'm new to VBA, why is this.



  #3   Report Post  
cindee
 
Posts: n/a
Default

Chip! Great to see you! I LOVE your website and recommend it often to my
clients! Thanks for just being you!

Cindee

"Chip Pearson" wrote:

You probably want to Clear the combobox before adding items to
it.

.Clear


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"aftamath" wrote in message
...
This is the code I have for a combo box,

Private Sub ComboBox1_GotFocus()

With ComboBox1
.Text = "Select Dimension"
.AddItem "Weight"
.AddItem "Flange Thickness"
.AddItem "OAL"
.AddItem "Body Length"
.AddItem "Counter Bore"
End With

End Sub

For some reason, the drop down menu lists these five options
seven times
over. I'm new to VBA, why is this.




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
eXceL 2003 - list or combo box question David Gerstman Excel Discussion (Misc queries) 2 May 23rd 05 03:58 PM
Combo box list question tanner g Excel Discussion (Misc queries) 1 April 21st 05 08:59 AM
dependent combo box list, with indirect reference Iyue Excel Discussion (Misc queries) 1 February 24th 05 10:45 PM
Combo box list depends on value Neal Excel Discussion (Misc queries) 3 February 1st 05 08:52 PM
Drop down list or combo box help needed metrueblood Excel Discussion (Misc queries) 1 January 12th 05 09:25 PM


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