View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default User Forms - Combo Boxes

#1. Make the .style fmStyleDropDownList

#2. Use .additem

Private Sub UserForm_Initialize()

Dim iCtr As Long
With Me.ComboBox1
.Style = fmStyleDropDownList
For iCtr = 1 To 4
.AddItem "A" & iCtr
Next iCtr
End With

End Sub

#3. I wouldn't use the formula in the cell. I'd duplicate the formula in code
and just make sure everything is valid before trying to display the results.
And maybe put a button on the form to "Evaluate This Data" that updates a
Label????



Michael Excel Dude wrote:

I'm designing a user form with Combo Boxes/List Boxes. I have three
related questions:

1. My combo box shows my list, but allows other input (other than the
value of the lists). How can I restrict entry to the only the choices
on the list?

2. I've set up my combo box with a reference to a range for the box
values. How do I embed the list values directly in the code instead of
a reference to cells?

3. When the user enters info in the various boxes of the user form, how
can I show a cell/box within the user-form showing the result of a
formula which uses the values entered in the form?

Any help would be appreciated.

Thanks!

--
Michael Excel Dude


--

Dave Peterson