View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
pallaver pallaver is offline
external usenet poster
 
Posts: 62
Default .AddItem list and populating combobox with created list

Hi Dave,

I entered in your code and I get the same problem: Excel highlights
".cboDirect" and I get the following "Computer Error: Method and data
member still not found." (at least that's what the translation means,
I'm working on a computer in Japan making troubleshooting excel/vba
even harder than it has to be).

To give a brief overview of what is going on, I'm trying to modify a
macro which is already built to add in a drop down combobox allowing
the using to either type in the number or select it from the drop down
menu. I've read though that the combobox allows for entry of only
inputs NOT already in the drop down list, hence my tangent above for a
text box.

That being said though, I still first need to figure out why I'm
getting an error every time I try and create a list. Any clues as to
what's going on?

Since, Neil


I'm not sure how RowWorkMin gets declared and changed, but this worked ok for
me:

Option Explicit
Private Sub UserForm_Initialize()
* * Dim i As Long
* * Dim RowWorkMin As Long

* * RowWorkMin = 77

* * With Me.cboDirect
* * * * .RowSource = ""
* * * * .Style = fmStyleDropDownList
* * * * .MatchEntry = fmMatchEntryComplete
* * * * For i = RowWorkMin To 88
* * * * * * Me.cboDirect.AddItem i
* * * * Next i
* * End With

End Sub

If you want to allow the user to type an entry that isn't on the dropdown list,
you can change the .style to fmStyleDropDownCombo. *(I'm kind of confused about
what you wanted.)