#1
|
|||
|
|||
Adding a long list of values to a combobox in Word 2003?
I have a list of over 50 value items that I want to add to my combobox in Word 2003. Please assist me on how I should type these values in VBA without getting a Compile Error: Syntax Error.
Here is an example of how I typed the code: Me.ComboBox1.List = Split("item 1 | item 2 | .......") & _ ("item 20 | item 21 |......") & _ ("item 48 | item 49 | item 50", "|") Please assist. |
#2
|
||||
|
||||
Try something along the lines of:
Code:
Dim StrItems As String, i As Long StrItems = "|item 1|item 2|.......|" & _ "item 20|item 21|......|" & _ "item 48|item 49|item 50" For i = 1 To 50 Me.ComboBox1.AddItem Split(StrItems, "|")(i) Next
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Populating ComboBox or Drop Down list with contents of a text field | Billy_McSkintos | Word VBA | 1 | 09-13-2011 05:50 AM |
2010 Outlook Favorites list too long | Emerogork | Outlook | 1 | 06-16-2011 05:05 PM |
Adding a long column of time increments in seconds | klippert | Excel | 1 | 09-18-2010 12:26 AM |
Long List for drop down box | DLo99 | Word | 0 | 02-28-2010 08:07 AM |
Fields controlled by List box values | farfromapro | Word | 0 | 02-11-2009 02:19 PM |