Userform list box population

I need to have a field in a user form to select from a list of options...
I guess I use listbox but I do not know how does it works... ho do I 
populate the lsit so it will show in the form?

I already place the question about two hours ago but it does not show in the 
forum so I guess it got lost in limbo.

Help is appreciated.
0
Utf
11/20/2009 7:17:01 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
860 Views

Similar Articles

[PageSpeed] 43

Hi,

I think you may need a combobox and one way of populating it is like this

Private Sub UserForm_Initialize()
For x = 1 To 10
ComboBox1.AddItem Sheets("Sheet3").Cells(x, 1).Value
Next
End Sub


Mike
"Alberto Ast" wrote:

> I need to have a field in a user form to select from a list of options...
> I guess I use listbox but I do not know how does it works... ho do I 
> populate the lsit so it will show in the form?
> 
> I already place the question about two hours ago but it does not show in the 
> forum so I guess it got lost in limbo.
> 
> Help is appreciated.
0
Utf
11/20/2009 7:31:05 PM
It worked great, thanks... but do I have to put the data in a row..? how do I 
do it in a column?

"Mike H" wrote:

> Hi,
> 
> I think you may need a combobox and one way of populating it is like this
> 
> Private Sub UserForm_Initialize()
> For x = 1 To 10
> ComboBox1.AddItem Sheets("Sheet3").Cells(x, 1).Value
> Next
> End Sub
> 
> 
> Mike
> "Alberto Ast" wrote:
> 
> > I need to have a field in a user form to select from a list of options...
> > I guess I use listbox but I do not know how does it works... ho do I 
> > populate the lsit so it will show in the form?
> > 
> > I already place the question about two hours ago but it does not show in the 
> > forum so I guess it got lost in limbo.
> > 
> > Help is appreciated.
0
Utf
11/20/2009 8:26:01 PM
'For range A1:J1
Private Sub UserForm_Initialize()
For x = 1 To 10
ComboBox1.AddItem Sheets("Sheet3").Cells(1, x).Value
Next
End Sub

OR

Dim cell as Range
For each cell in Sheets("Sheet3").Range("A1:J1")
ComboBox1.AddItem cell.Text
Next



If this post helps click Yes
---------------
Jacob Skaria


"Alberto Ast" wrote:

> It worked great, thanks... but do I have to put the data in a row..? how do I 
> do it in a column?
> 
> "Mike H" wrote:
> 
> > Hi,
> > 
> > I think you may need a combobox and one way of populating it is like this
> > 
> > Private Sub UserForm_Initialize()
> > For x = 1 To 10
> > ComboBox1.AddItem Sheets("Sheet3").Cells(x, 1).Value
> > Next
> > End Sub
> > 
> > 
> > Mike
> > "Alberto Ast" wrote:
> > 
> > > I need to have a field in a user form to select from a list of options...
> > > I guess I use listbox but I do not know how does it works... ho do I 
> > > populate the lsit so it will show in the form?
> > > 
> > > I already place the question about two hours ago but it does not show in the 
> > > forum so I guess it got lost in limbo.
> > > 
> > > Help is appreciated.
0
Utf
11/21/2009 1:14:01 AM
Reply:

Similar Artilces:

Date format issue when submitting from a userform to a spreadsheet
Hi, I have a userform that I've generated which routes dates onto a spreadsheet based on the users input. I am having a bit of a frustrating time with the dates, it would appear that in the process of moving the date from the userform to the spreadsheet some dates are switched/transposed. I'll give an example. If someone enters 09/02/2004 on the userform excel seems to look at 09 and assume it is a month and transposes the dates to 02/09/2004(this does not appear to be a US/UK format issues as I have already gone down that road). However, if the date 13/09/2004 is entered i...

Smart List problem
I recently re-installed a client (version 9.0). Everything went fine but when we tried to open Smartlist on this client we got an error message telling us that “To use Smartlist capability in this product the Smartlist tables must be built. This is one time initialization process and may take a few minutes”. I answered yes, it ran and then returned the following error “number of columns does not match table definitions”. Every other machine is working fine, is the tables it is talking about building on the client? It does not seem like that should be so. It does not matter ...

Cloning a price list
Is there any way either through the standard user interface or through the CRM SDK to clone an entire price list? TIA Not an option under standard UI Need to use SDK. Good luck. Frank Lee Workopia, Inc. http://www.workopia.com/Links.htm San Francisco, CA "JB" wrote: > Is there any way either through the standard user interface or through > the CRM SDK to clone an entire price list? > > TIA > > ...

custom address list for EXTERNAL email addresses
I know it is possible to create a custom address list in Exchange 2003 for internal use but how about for external email addresses outside of a company? Is this possible?? Any help would be appreciated. Thanks in advance. Create contacts for each of the external mail addresses and add them to the distribution list. If add a valid internet email address to the distribution list external people can also send to it. Glen "Steven Peters" <Steven Peters@discussions.microsoft.com> wrote in message news:CBF2F2AE-ABF4-491C-836C-59611375F9F1@microsoft.com... > I know it is pos...

Comparing first and last names in two lists
I have two data sources that each contain about 8000 names in seperate fields for first and last name. I can put them on seperate worksheets or append one to the other. I need to make them match and find out where they don't. Messed with consolidate but not sure if that will work for more than one column at a time. FYI data set one is from a school transportation database and data set two is from the main student database from the same school district. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages dir...

List control selction and deselection
For selecting an item from a CListCtrl just call mList.SetItemState(iItem,LVIS_SELECTED | LVIS_FOCUSED, 0xFF) during Initialization For deslecting we need to insert item once again, ie mList.DeleteAllItems() mList.InsertItem() i know this is not a good method, but i didnt get any other options. if anyone know, pls let me know!!! Regards "johnWins" <johnsvakel@gmail.com> wrote in message news:2ccf2c5c-eb5c-46fd-9bd5-30d89d2048f6@v67g2000hse.googlegroups.com... > For selecting an item from a CListCtrl just call > > mList.SetItemState(iItem,LVIS_SELECTED | LV...

Changing the Selection Fields in a Combo Box
Hi, I've created a Combo Box using the Controls Wizard. In creating the control, I specified that my unique value to be stored in the table is an ID. When the user views the selection options in the Combo Box, I'd like to have the ID field hidden and only see the text values, while still storing the ID in the appropriate column. This is probably a second question. Also, when the user views a form that has been populated, I'd like them to see the actual textual values on the form, as just the stored ID value. Is that possible to do with the one Combo Box or is that...

Category to Distribution List
Dear All: A: Outlook 2003 B: OS = XP Is there a way to create a Distribution List from a category ? I have a number of clients in special categories ( usually company name) However, there are times when I want to send BCC to several clients and would like to find a way to send that email without having to insert all the names. The category list of names can only be in the To: portion of the outgoing email. Suggestions highly appreciated. John A Hansen Two methods, both starting with the folder grouped by category, and all = the items in the category selected:=20 1) Choose Actions |...

Contact looses Post Office Box field when synchronized to Outlook
When I sync contacts from CRM 4.0 to Outlook, the Post Office Box field from the contact gets empty. Anyone has the same issue? ...

Stop use of Distribution List
Is there anyway that you can stop, or restrict the use of a distribution list? Since you have so much detail of how you are setup and if there are specific people or groups you want to restrict from using it, I will answer your question with the same amount of detail....YES. Add more detail and we can give you a better answer. "brendanrtw" <brendanrtw@discussions.microsoft.com> wrote in message news:6CB3EB2F-F428-46AD-A41E-A1495B8CF4CD@microsoft.com... > Is there anyway that you can stop, or restrict the use of a distribution > list? On Thu, 3 Nov 2005 12:00:...

List Running Horizontally-Pivot Table Possible?
I just had a customer ask this one and I'm not so sure about it. 1) The customer has setup a list of information that is running horizontally instead of the typical list running vertically. 2) I just taught him how to do pivot tables and he wants to generate a pivot table with his "horizontal" list. 3) I know he can copy and paste special and use the Transpose feature to change the list from horizontally oriented to vertically oriented. 4) the question is: can he leave the table in its original orientation and still generate Pivot tables? I can't seem to make it work ...

How can I parse or Loop a list based on single field to Googlemaps
This is some code that will parse each sequential field [Point_#) into a list for googlemaps. [Form_Runs].WebRouteMap.navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & (" to: " + Me.Point_2) & (" to: " + Me.Point_3) The table/form is laid outlike this: [Route_No] [Point_1] [Point_2] [Point_2] 5 North St, N1 East St, N3 High Road, W6 And the code will give this style of parsed list: from: North St, N1 to: East St, N3 to: High Road, W6 That works just ...

selecting multiple choices from a drop down list
I have a drop down list in a cell and I want to be able to selec multiple entries from that list. Does anyone know how I go this -- Message posted from http://www.ExcelForum.com If this is a data validation list, you could use code to compile a list of selected items. For example, if the data validation is in column C, the following code will store the selected items in the same row in column D: '============================= Private Sub Worksheet_Change(ByVal Target As Range) Dim rngDV As Range Application.EnableEvents = False If Target.Count > 1 Then Exit Sub On Error Resume N...

Rule to automatically mark header to download based on contact list?
Is there a way to do this, or an add-in? TIA. Rich On Tue, 26 Apr 2005 04:44:35 -1000, rmc <rmc@nospam.com> wrote: > Is there a way to do this, or an add-in? What version of Outlook are you using? -- -Ben- Ben M. Schorr, MVP Hi Ben: 2003 SP1 Rich "Ben M. Schorr - MVP" <bens@bogusaddress.mvp> wrote in message news:op.spuxh8sf6r4cx1@bms-tablet2.scgab.com... > On Tue, 26 Apr 2005 04:44:35 -1000, rmc <rmc@nospam.com> wrote: > > > Is there a way to do this, or an add-in? > > What version of Outlook are you using? > > > -- >...

Making words in a list a value!!
I am trying to create a list that will generate a value in another column once that word or phrase is chosen. Is this possible and how. Exp. In the drop down list I would chose Product, then in the price column the price automatically appears. brco1, Much better than I could ever explain the process. Here's exactly wha you need. http://www.contextures.com/xlFunctions02.html HT -- Case ----------------------------------------------------------------------- Casey's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=454 View this thread: http://www.excelforu...

List Box Point-to-Select (MouseMove)
I have a list box that shows files from my hard drive. I'd really like to have it select the item being pointed to as I move my mouse pointer over it. I have coded this and it works fine unless the list is scrolled. I need a way to offset my list index to account for how far down the list has been scrolled. I can't find a list box property that will allow me to determine where a scrolled list is positioned. Something giving me the list index of the first visible row would do the trick. I haven't been able to find anything so far. I've tried some VB code that uses the Send...

List folders to file
Hi Does anyone have a macro that would list all the folders (with path) and subfolders to an excel sheet but not the files? Thanks Shona Shona- There's a function called CELL() that should return your filename (or any of a number of parameters) but I can't get it to work properly on my machine, so I can't make it work for you. The syntax is =CELL("filename") which ought to return the path and filename of the current file, and which you could then trim down to show just the path. Can anyone provide some guidance here? Dave, If it isn't working for you, it pro...

Combo
Hi, I am able to create a list of items with a drop down menu. I can select specific item but how do I select all item to get a query output. Your help would be much appreciated. Thanks You can't select multiple items from an Access combo box. To do that would require a listbox with it's MULTI-SELECT property set to SIMPLE or EXTENDED. See more info about list boxes here: http://www.fontstuff.com/access/acctut11.htm -- Bob Larson Access World Forums Super Moderator Utter Access VIP Tutorials at http://www.btabdevelopment.com __________________________________ If my post ...

Disable people picker in a sharepoint list
Dear all, I would like to disable the users/groups picker field in a SharePoint list (NewForm.aspx). I managed to disable the field itself (text box) but it's still possible to click on the "Browse" button and search for people that then get eneterd in the field. Is there a way to disable the browsing? Thank you in advance, Hrvoje I think you will delete that column. 1. Settings>List settings>Click you wnat column name on Colums category. 2. Click "delete" button. And then you can make other column. "Hrvoje" wrote: > ...

Combining Lists within excel.
I'm hoping someone can help here. I'll try to explain the problem I have. I have 2 worksheets both containing a product list. I have entries on one worksheet which I need on the other, so basically my question is... might there be a way of combining these two lists so one updates the other with the missing entries. Help on this would be great, as they are very large lists which I dont much fancy the thought of looking through them manually. Are you familiar with the VLOOKUP function? I use it all the time for this type of problem. vlookup(Product cell in first sheet, Array...

CHECK BOX CONTROL USING EXCEL 2000
I am working on a worksheet that has over 2300 rows. I would like to have one field on each row to contain a true or false value. I'd like to have a check box being referenced to each cell. I'd like to be able to copy the control and have it maintain a relative cell value in the link cell property. Right now when I copy the control to the other 2,300 rows, the link cell is a4 and every control uses the same value at a4. Cell a4 is the only cell that changes values when any check box is clicked. How do I conect the check box control to a specific/different cell without ma...

Large distribution lists
Hi all, Is there a way to have a distribution list send a message to each user individually instead of having all the emails stuffed into the "To" field? We are a federation and we send emails to our members regularly via a distribution group and there are a lot of bounces saying: #5.6.0 smtp;552 5.6.0 Headers too large (32768 max)> I tried splitting the distribution list by regions, but some regions still contain too many email addresses. Do I have to look at a third-party application just to do that? TIA for any suggestions/ideas! Mail merge in Word. "Eric Ca...

Comparing Two Lists #2
I have to compare two account balance downloads to reconcile an inte company account. The only field I can match between the two lists i the value, unfortunately no dates correspond, nor text fields. I had originally planned on using a vba routine that coloured value found in both lists, or an array formula. i went with the vba Unfortunately the code identified all the matching cells, ie, the valu �300 appeared twice in List A but only once in List B. The cod coloured both of these values in List A, and the singular entry in Lis B. I only need to colour one value in List A as it nets off One...

Return the "name box" to the tool bar.
The "name box" disappeared from the tool bar. The name box is ususally on the left end of the format tool bar. It allows the user to view the underlining formulas etc. as opposed to the data or answer displayed in the cell. One way: Tools/Customize. In the Toolbars pane, select Formatting toolbar (e.g., "Formatting" highlighted, not just the checkbox checked). Click Reset. In article <8E82A125-6086-4686-8E53-9F96823C083E@microsoft.com>, ^mike^ <^mike^@discussions.microsoft.com> wrote: > The "name box" disappeared from the tool bar. Th...

Is there a way to test if a control exists on a userform?
I have a sub (ClearUserform) that is called by several userforms. Sometimes the control may not be on the userform passed to ClearUserform, thus I get an error. So I added the On Error Resume Next statement to quickly work around the error. Is there a way to test if the control exists on the userform passed to the sub. Sub MySub() Call ClearUserform(Userform1) End Sub Sub ClearUserform(MyForm As UserForm) On Error Resume Next MyForm.TextBox1 = "" ' i have other controls list here On Error GoTo 0 End Sub -- Cheers,...