Populate 2nd combo box based on value selected in first combo box?

I have 3 combo boxes.  The first one is static inputs, the second need
to be populated with inputs (via .AddItem) based on which input th
user selects from combobox one.  The third needs to be populated (vi
.AddItem) based on what the user selects for the input in combobox 2.
Is this possible??  Thanks...

Chad!

BTW..this form runs, but cmbFile is only populated with ".bsn"

Private Sub UserForm_Initialize()
'populate the 1st combo box - this is static info
With cmbParam
.AddItem "Flow"
.AddItem "Sediment"
.AddItem "Phosphorous"
.AddItem "Nitrate"
End With
'now i need to populate the second box based on which input value wa
selected above
'this if statement below doesnt work, but it illustrates what i want t
do
'if statement for population of 2nd combo box
If cmbParam = "Flow" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".gw"
.AddItem ".hru"
.AddItem ".mgt1"
End With
ElseIf cmbParam = "Sediment" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".hru"
.AddItem ".mgt1"
.AddItem ".rte"
End With
ElseIf cmbParam = "Phosphorous" Then
With cmbFile
.AddItem ".bsn"
.AddItem ".mgt2"
.AddItem ".sol"
.AddItem ".swq"
.AddItem ".wwq"
End With
Else: cmbParam = "Nitrate"
With cmbFile
.AddItem ".bsn"
End With
End If
'next i need to populate the final combo box based on what input valu
was selected in the 2nd box
'below are the values for the 3rd box
With cmbVar
.AddItem "GWQMN"
.AddItem "REVAPMN"
.AddItem "GW_REVAP"
.AddItem "CN1"
.AddItem "ESCO"
.AddItem "USLE_K1"
.AddItem "SLOPE"
.AddItem "CH_N2"
.AddItem "SLSUBBSN"
.AddItem "APM"
.AddItem "PRF"
.AddItem "SPCON"
.AddItem "SPEXP"
.AddItem "USLE_P"
End With
End Su

--
Message posted from http://www.ExcelForum.com

0
5/18/2004 9:34:29 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
639 Views

Similar Articles

[PageSpeed] 15

Of course it is. Give me your email address and I will mail you an example
workbook.

-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"cdc01 >" <<cdc01.16h0zf@excelforum-nospam.com> wrote in message
news:cdc01.16h0zf@excelforum-nospam.com...
> I have 3 combo boxes.  The first one is static inputs, the second needs
> to be populated with inputs (via .AddItem) based on which input the
> user selects from combobox one.  The third needs to be populated (via
> AddItem) based on what the user selects for the input in combobox 2.
> Is this possible??  Thanks...
>
> Chad!
>
> BTW..this form runs, but cmbFile is only populated with ".bsn"
>
> Private Sub UserForm_Initialize()
> 'populate the 1st combo box - this is static info
> With cmbParam
> AddItem "Flow"
> AddItem "Sediment"
> AddItem "Phosphorous"
> AddItem "Nitrate"
> End With
> 'now i need to populate the second box based on which input value was
> selected above
> 'this if statement below doesnt work, but it illustrates what i want to
> do
> 'if statement for population of 2nd combo box
> If cmbParam = "Flow" Then
> With cmbFile
> AddItem ".bsn"
> AddItem ".gw"
> AddItem ".hru"
> AddItem ".mgt1"
> End With
> ElseIf cmbParam = "Sediment" Then
> With cmbFile
> AddItem ".bsn"
> AddItem ".hru"
> AddItem ".mgt1"
> AddItem ".rte"
> End With
> ElseIf cmbParam = "Phosphorous" Then
> With cmbFile
> AddItem ".bsn"
> AddItem ".mgt2"
> AddItem ".sol"
> AddItem ".swq"
> AddItem ".wwq"
> End With
> Else: cmbParam = "Nitrate"
> With cmbFile
> AddItem ".bsn"
> End With
> End If
> 'next i need to populate the final combo box based on what input value
> was selected in the 2nd box
> 'below are the values for the 3rd box
> With cmbVar
> AddItem "GWQMN"
> AddItem "REVAPMN"
> AddItem "GW_REVAP"
> AddItem "CN1"
> AddItem "ESCO"
> AddItem "USLE_K1"
> AddItem "SLOPE"
> AddItem "CH_N2"
> AddItem "SLSUBBSN"
> AddItem "APM"
> AddItem "PRF"
> AddItem "SPCON"
> AddItem "SPEXP"
> AddItem "USLE_P"
> End With
> End Sub
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
bob.phillips1 (6510)
5/18/2004 10:25:53 PM
Bob:

cdc01[AT]uark.edu

thanks...

Chad

--
Message posted from http://www.ExcelForum.com

0
5/18/2004 10:34:03 PM
Reply:

Similar Artilces:

User-inserted external file path used to pull cell values
I have an organization that wants each vendor to fill out and submit a net present value worksheet as part of the RFP process. Call it the NPV workbook. The organization wants to then pull data from each of those worksheets into a summary worksheet. I would like for the organization to be able to input the file path for each NPV workbook. Then the summary cells would use the file path to pull the data. What I have been trying so far isn't working: 1) Organization creates a hyperlink to each NPV workbook; example: Cell B8 contains the hyperlinked string: F:\Emergent\Projects\03109 GSA ...

Formula to Count and Return Most common Value in a Dynamic Named Range #3
Hi Frank, Assistance and explanation much appreciated. The Formulae yo suggested are working well. Thanks Tin´┐Ż Frank Kabel Wrote: > > Hi > (1) The '1' indicates that the result of the subtotal function should > be one. As SUBTOTAL is only used with one single cell at a time the > result is either '0' (filtered') or '1' (#visible'). > > (2)a For using a defined name try the array formula: > =MODE(IF(SUBTOTAL(3,OFFSET(INDEX(range,1,1),ROW(range)-ROW(INDEX(range, > 1,1)),0))=1,range+{0,0})) > > Note: the +{0,0} part ensures ...

Cell right next to colored cells is automatically colored on entering a value
Hello, I recently started to program in VBA for Excel. I'm using Excel 2000 (9.0.4402 SR-1) on Windows XP. The formatting from all the cells in the workbook and worksheet is General (Right-click on a cell, Format cells, then tab Number, Category-listbox: General) When I put a commandbutton CommandButton1 on the first worksheet of my workbook and I put the following code in the CommandButton1-onclick-event. ------------------- Option Explicit Private Sub CommandButton1_Click() Dim WeekdayNames(0 To 6) As String Dim WeekdayColors(0 To 6) As Long WeekdayNames(0) = "mond...

Putting database data into a combo box...
Hi guys, I have a working databse query thar returns a list of names. I want to put this into a combo box. Currently I am inserting the database data into a range on my spreadsheet (A1) and it uses as many rows as there are names. In my combo box properties I can specify the ListFillRange as A1:A5 or whatever and this works okay, but the thing is, as names are added to the database, I want the range A1:A5 to update dynamically. Q1. Can I send the QueryTable data directly to the combo box ListFillRange... With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=ComboBox1.Lis...

Investment Market Value over Time in Money 2004
I was wondering if there is a way to get a graph of a particular investment's (or investments) value over time? Right now I can use MoneyLink to extract the investment's price history and transactions. It is fairly straightforward to use these two data sets to get Market Value vs. Date, but it is slightly tedious, especially when there are more than one investment. I'm hoping to find a more automatic way of producing these graphs. It would also be great if I could put the market values over time of multiple investments on a single graph. Any suggestions would be appreciated. T...

Loop to retrieve value in worsheet A and put into worksheet B
I am hoping someone out there cyber-world can help me with some code that I need. I have a workbook from an outside source. I need to loop through Worksheet named "Details", column A to find the characters "C:" and return the value from Worksheet "Details" , column B into Worksheet "New Details", Column A. There are blank rows in the data and the only designation between what would be considered a new record is a series of dashes (14 dashes to be exact). Is Anyone able to help with this? Anything is greatly appreciated. Is there an...

Multiple Prompt CryptoAPI Private Key Dialog Box
Hi there... I have problem implement the S/MIME + PKI while integrating with Ms Outlook or Outlook Express...Generation the certificate I don't have any problem but when Ms Outlook prompt the CryptoAPI Private Key it will ask one time only...If I want the dialog box appear again I have to close and open back Ms Outlook then the popup dialog asking enter the CryptoAPI Private Key. Is there any solution I have to make Ms Outlook prompt dialog many times when I try to send email ? Any solution ? Thanks ...

Selecting several messages
When I used OE I used to be able to select several messages at a time in order to file them. By holding down the Ctrl button I could check the content of each message as I clicked it. I cannot do this with Outlook as it will only allow the first message clicked to be viewed. Is this correct or is there a way around this? -- Valerie Valerie <Valerie@discussions.microsoft.com> wrote: > When I used OE I used to be able to select several messages at a time > in order to file them. By holding down the Ctrl button I could check > the content of each message as I clicked it....

Filter rows containing cells with values within a range (for example <11 or >10 but <21)
Column B consists of Brand names (each brand has numerous products) Column C consists of Product names (over 500 products) Coumns D to CG (row 1) consist of months going back a few years. The data from D2:CG539 consists of the rank of each brand for each month. I would like to filter my rows so that I can view only the products that have ever ranked in the top 10. I already have a couple of formulas that allow me to filter my data. Example 1: If I want to know the highest rank ever achieved by a product I use this formula: =MIN(D2:CG2) and then drag it down. Now I can use autofilter and see w...

SMTP Emails not arriving in users mail box
Hello, I have a puzzeling problem! I have a user that has worked here for sometime. He has an address john@domain.com. Now for some reason external people that used to send him mail everyday or quite often has stopped going to him, the mail has stopped comming through to him and is being redirected to the administrator (as setup to do so in Exchange when it can't find the user). In his email addresses screen it is definatly in there as an SMTP address. When I send a test to this address from my hotmail account, the mail comes through to him!! I have checked with a number of the ...

Create Modeless Dialog Boxes Query?
Hi Experts I have an SDI explorer type application with a tree view and a list view. In the listview i show the thumbnails of all the bmp files in a specific folder. Now when the user double clicks on any thumbnail i want to dynamically create a modeless dialog box. Now is it possible to specify the width & height of the modeless dialog box at the time of creation, say i want the dialog box to be of the size (400,300). If this is possible how can this b dun? Waiting for comments Regards mathu mathu, See below "Snav" <davinder_76@rediffmail.com> skrev i meddelandet ...

First access after installation
After installing CRM 3.0 i want to access the crm over http://servername:5555/ A Login window apears and i put in my login name and password - the next page says page can not be found error 404 So which login information is needed - the normal domain login? Do i have to check something in the IIS? any help would be fine. best regards from germany richard It would be the same domain user account used for installation. "Richard" <Richard@discussions.microsoft.com> wrote in message news:0CED60F4-6AC2-4491-8E28-4465C19F8386@microsoft.com... > After installing CRM 3.0 i...

Run Macro If Cell value = "Other"
Alright, I have a very simple macro at the moment that unhides a column and adjusts the print area to suit. What I need is a maco that will run this macro if the cell F4 = "Other" from a drop down menu. Seems painfully simple I just can't find where it is. Cheers If Range("F4").Value = "Other" Then Call yourMacro End If -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) <bobbly_bob@hotmail.com> wrote in message news:1163993734.539069.261810@j44g2000cwa.googlegroups.com... > Alright, I have a ...

summing based on substring
I receive a xls weekly with hit data for a web site. The data are in the following form (note: there's 2 cols): abcfoo 2 abcbar 6 deffoo 4 defbar 1 ghibar 2 I need to sum up the data based on the last 3 characters (bar and foo above). Ideally, I'd like two new cols where each row would correspond to a 'bar', 'foo', or whatever, column 1 containing 'bar', 'foo', etc and the 2nd column being the sum for that substring. Any hints for doing this would be greatly appreciated!! TIA, David =SUMPRODUCT(--(RIGHT(A1:A5,3)="bar"),B1:B5) =SUMPRODUCT(-...

If check box changes
Access 2003 On my subform I have 3 checkboxes format Yes\No BBAll - control source BBAll default Yes BB1 - control source BB1 default No BB2 - control source BB2 default No and 2 textboxes TextBB1 - control source =DLookUp("[BB1]","[t000Facts]","[UnitID] =" & [UnitNo]) TextBB2 - control source =DLookUp("[BB2]","[t000Facts]","[UnitID] =" & [UnitNo]) If TextBB1 is null then BB1.enabled=false If TextBB2 is null then BB2.enabled=false this means if TextBB1 is empty then the BB1 checkbox selection is disabled(s...

Validate parameter based on a XSD
The data type of a property in one of my class is defined in a XSD document as xs:ID. Is it possible I can validate the property by using the XSD? I can hardcode the validation, but I will have to changed the code in case XSD changed. thanks JS You can use the XmlSchemaValidator in .NET 2.0 to perform XSD validation over your custom object model. http://msdn2.microsoft.com/en-us/library/system.xml.schema.xmlschemavalidator(VS.80).aspx Thanks, Priya "Jinsong Liu" <Jinsong@mssolution.com.nospam> wrote in message news:v9qc52dcihd0k6cn2v6kep0n7e1ads9sf3@4ax.com... > The ...

Click Boxes for each series in a graph
I have a chart with three series over time. Lets say the range is C2:Z5. The time is expressed in row 2 and the series data in rows 3,4,5. I want to be able to turn the series on with click boxes. I have the graph set up on a worksheet so that some of the cells of the worksheet are visible. I want to avoid VBA code (for now). So I would like to set up checkboxes on the spreadsheet itself (if possible). I want to be able to click the checkbox for each series. When checkbox is click series is visible when not clicked series not visible. Any ideas on how to do this? Thanks. Hi ...

Modeling Data Base, how can i do it??
Hi, sorry for my english, I have a problem of conceptual design of my database, i hope you can help me. This is a shop with a variety of articles (Posters, mobiles, decorative objects among others), which have different characteristics, Paint: size, author, image, ... Moviles: brand, size, weight .... Flashlight: Power, material, color, ... ......... ......... I decided to make a table tblCategoria and another tblArticulo: TblCategoria: id, name, description, picture TblArticulo: id, category, images, prices And here i have the problem, I would like how to save every property of the articl...

Color-filled boxes, borders aren't visiable on screen only in prev
We have Microsoft Office Small Business Edition 2003 on the computers at work. A coworker and I collaborate on a newsletter via our shared documents folder on the server. For no obvious reason, when she was working on the newsletter in Publisher today, none of the color fills, transparencies or text box borders would show up on the screen. The Format text box tabs show what she did and the changes are visiable in the print preview window, but not on screen when actually working in the document. The same document works fine and shows everything when I pull it up on my computer. I made s...

Change format of one cell based on another
Hi. How do I change the format of one cell eg make the fill colour of cell A1 yellow, based on another eg if cell A4 is greater than 100%? Thanks. format...conditional formattin -- Message posted from http://www.ExcelForum.com Thanks, but how do you reference another cell? >-----Original Message----- >format...conditional formatting > > >--- >Message posted from http://www.ExcelForum.com/ > >. > in conditional formatting under condition 1 select "formula is" and the put in the formula you wan -- Message posted from http://www.ExcelForum.com &q...

Combo No Change and After Update Event
I have a combo box where the After Update event of the combo box is used to reset another control on the form to Null. Sometimes a user will want to reconsider his/her choice in the combo box and make a different selection from what was there before. This is OK as it triggers the resetting of the other control to Null. My problem is - sometimes the user will revisit the combo box and explore the other possible selections in the combo but eventually settles back on the original selection with the result that the After Update event is triggered and the other control value is scrubbed, which i...

OTHER options for chart not plotting null ("") or zero values
I've read the above suggestions for a chart not plotting zeros or null values. This worked....however, then I got errors because of other calculations (averages) that use these cells as references (and #NA just doesn't go over well when it's being used in another formula). Because of the many other formulas (in visual basic and in the exel file) that would need to be changed if i created an extra column, or did some of the other options I would REALLY prefer to not do any of those. Isn't there some way within the chart's options to exlude these values? Or is my best ...

Data from a form populating a table
I have a form set-up with combo boxes from multiple tables. Once all of the data is entered into the form I would like to press a button and have the information from the form export into a separate table. Example: from a combo box the person could choose the origin city (from a city table), choose the origin state (from a state table), enter in a dollar amount (in a text box). Once they have entered the information the user could click on a button and have the data go into a different table. Does this make sense? Can someone tell me how to make this work? Appreciate any help that...

Auto populate form field based on selection
Hi, I have a form which is linked to a table(tblAntibody) for data entry. I have another table(tblCatalogPartNumbers) with no relationship to the first which contains all of our codes and has four coulmns CatalogNumber, UnqualifiedNumber,NIPartNumber, and PIPartNumber. All of these columns store thier data in tblAntibody. On the form CatalogNumber is a combo box that has it's selection criterial set to tblListCatalogPartNumbers. What I need to happen is when a user selects a catalog number from the combo box, I need the other 3 fields to auto populate from tblCatalogPartNumbers. Catalo...

Dynamic Bar of Pie Chart: Series1 Label & Value Issue
I have created a Bar of Pie chart and everything works great. I even have named ranges on my data so that the bar portion automatically updates when the data changes. However the Series1 Label on the pie itself does not change to reflect the new total so that it is the sum of all the values in the right column below. Does that make sense? I have one series and my data looks like this: Contracts 100 Name1 100 Name2 150 Name3 200 Name4 75 Name5 50 Name6 25 The pie portion has Contracts & Other as labels with the totals of...