+ Reply to Thread
Results 1 to 16 of 16

x2 COMBO Boxes to Find price VBA Code

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    x2 COMBO Boxes to Find price VBA Code

    Hi all,

    I have X 2 combo Boxes and a text box,

    What I need is When the first combo box is selected it shows the relevant details in combo box 2, then when combo box 2 is selected it shows the Information in the text box,

    Example..

    Combo box 1 - List = MILES [5,10,15,20,25,30] E.T.C
    Combo Box 2 - List - Location [RTW AGG Plants, RTW Linford, RTW Alfreton]
    Text box 1 to show related price, based on miles & location.

    Thanks

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    See example in sheet1 ;-
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    Thanks Mick G - but how can I determine what text shows based on combo box 1 and 2, Your example just shows Combo box 2 Result in the text box? Is that correct ?

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    Change the code in the sheet Module as below to add Combobox1 as shown:-
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    I think im confusing you,

    I need example,
    Combo box 1 - Say I chose 5 miles from the selection, - Then combo box 2- say I choose Linford as the location, the text box is to show £300.00
    But if I chose 5 miles from Combo box 1 but say Alfreton from combo box 2 the price changes to £375.00 ?

    Thanks

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    Where is the list of prices based on Location and Miles
    Please show list of "Miles,Location,Price"

  7. #7
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    see attached my Workbook, Thanks. See sheet FDC -

    Column A with miles -
    Colum B - 3 plant Locations [Repeated for each variable of miles]
    Column C- price
    So 5 miles has 3 different price's depending on what location is Location Selected.

    User form Labelled Boxes.

    Combo Box 1 - CBOfdm
    Combo Box 2 - cboplantlocation
    Text box - Txtfdc

    Thank you

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    Try this:-
    NB:- I had a intermittent problem opening "Userform1" so I added an "CommandButton", but you may find your original "Button" works perfectly OK !!!
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    Thanks Mick, Sorry about the confusion. I attached the wrong workbook earlia, this is the most uptodate one, So sorry -Any chance you could swap the code over to this workbook? I have tried but im getting a code error? =( Thanks in Advance for your time.
    Attached Files Attached Files

  10. #10
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    Try this:-
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    Thank you so much .... So much Appreciated....

    Do you know how to Automatically Get the userfrom to input a reference for each record..
    Example 001, then when I press ok and the record saves and I enter a new one the New reference number become 002 Automatically.

    Also if I close the form and then re-open it picks up the last available reference number.?
    Thanks

  12. #12
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    My Box for this is TEXTURN. and Its column A on my Sheet? Thanks in advance

  13. #13
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    Perhaps this:-
    "See "Sheet Activate" code and "CommandButton" "OK" code.
    Numbers logged in sheet "Master" col "A"
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    Thanks Mick, But its not writing any of the data to my sheet when I press "OK" ? its generating the number though ?

    Thanks

  15. #15
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 COMBO Boxes to Find price VBA Code

    I "Remarked" out the other code in the "OK" button so you could fit it around the Numbering code.
    I can see that there is a lot of work on that Userform, far beyond being able to point you in the right direction !!!

  16. #16
    Registered User
    Join Date
    03-20-2014
    Location
    wolverhapton
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: x2 COMBO Boxes to Find price VBA Code

    Oh right ok, Im stuck then now Thanks for your help so far anyway.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with code for userform text boxes, combo boxes and excel
    By innerise in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2014, 09:07 AM
  2. I need a code for presence check to check multiple text boxes and combo boxes
    By Lee_wwfc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2013, 01:53 PM
  3. combo box user form code for two combo boxes
    By robert.begley1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-01-2012, 02:25 PM
  4. Need help with creating a command box in excel (VBA code) that hides combo boxes
    By aritops in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 08:45 AM
  5. how to write vb code for multiple combo boxes
    By HFB in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-21-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1