View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Creating an Excel combo list in VBA

This is the code I used. the only chbanges I did was to break the string
into multiple lines. I wondering if the problem has something to do with the
length of the string. I'm using excel 2003, don't know if there is a problem
with excel 2007.

Sub test()

Columns("N:N").Select
With Columns("N:N")
Selection.Locked = False
.Validation.Delete
.Validation.Add xlValidateList, , , _
"Example 1, Example 2, Example 3," & _
"Example 4, Example 5, Example 6," & _
"Example 7, Example 8, Example 9," & _
"Example 10, Example 11, Example 12," & _
"Example 13, Example 14"
Cells.EntireColumn.AutoFit
End With
End Sub

"Nico" wrote:

No, it cuts off at eight, mid-sentance on the eighth. I can't scroll further.

"joel" wrote:

Is there a slide bar in the right hand side of the combobox? I get only 8
values until I slide the bar to see the other values.

"Nico" wrote:

Hello,

I'm trying to create a combo list in Excel with the following VBA code, but
it cuts off after only eight lines. Any suggestions?

Columns("N:N").Select
With Columns("N:N")
Selection.Locked = False
.Validation.Delete
.Validation.Add xlValidateList, , , "Example 1, Example 2, Example
3, Example 4, Example 5, Example 6, Example 7, Example 8, Example 9, Example
10, Example 11, Example 12, Example 13, Example 14"
Cells.EntireColumn.AutoFit
End With

Unfortunately it also cuts off some lines (here listed as "Example X") which
are long. Is there a character limit? I can't find any reference to one, but
I'm not sure why else it would cut off?

Thanks!