LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default .additem

Maybe you can just do one item by item and use that list for the second
combobox.

Option Explicit
Private Sub UserForm_Initialize()
With Me.cboCount1
.AddItem "1"
.AddItem "2"
.AddItem "3"
End With
Me.cboCount2.List = Me.cboCount1.List
End Sub

Or just build one array and use it twice:

Option Explicit
Private Sub UserForm_Initialize()
Dim myArr As Variant
myArr = Array("1", "2", "3")
Me.cboCount1.List = myArr
Me.cboCount2.List = myArr
End Sub



ernie wrote:

i have two combo boxes: cboCount1 and cboCount2.
i have a long list of same items added to the drop down list of both combo
boxes.

With cboCount1
.additem = "1"
.additem = "2"
.additem = "3"
End With

With cboCount2
.additem = "1"
.additem = "2"
.additem = "3"
End With

I need to make my codes as short and compressed as possible. I want to use
the same list for both combo boxes but use a shortcut. How can i achieve this.

thanks in advance


--

Dave Peterson
 
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
dropdownmenu with additem Peter[_55_] Excel Programming 1 September 25th 05 01:28 AM
combobox additem masterphilch Excel Programming 2 October 25th 04 11:04 PM
additem performance Mark[_51_] Excel Programming 2 September 8th 04 12:37 PM
AddItem Method Todd Huttenstine Excel Programming 3 April 21st 04 03:53 PM
.additem Robert Couchman[_4_] Excel Programming 3 February 20th 04 02:47 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"