Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 12
Talking User Forms - Combo Boxes

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
  #3   Report Post  
Junior Member
 
Posts: 12
Default

Thanks Dave, that worked great!

Quote:
Originally Posted by Dave Peterson
#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
Reply
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
Joined Combo Boxes Squeaky Excel Discussion (Misc queries) 0 May 2nd 06 03:20 PM
Boxes in Forms PaulW Excel Discussion (Misc queries) 0 March 10th 06 03:18 PM
Combo Boxes for data entry moorefun Excel Worksheet Functions 1 February 3rd 06 09:03 PM
How to create & use User Forms DCSwearingen Excel Discussion (Misc queries) 2 December 27th 05 05:09 PM
Nesting Combo Boxes /Returning an Array ELMONDO SNITHER Excel Discussion (Misc queries) 1 June 30th 05 01:15 AM


All times are GMT +1. The time now is 11:15 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"