+ Reply to Thread
Results 1 to 2 of 2

Add range instead og item to combo in userform

  1. #1
    Registered User
    Join Date
    03-03-2012
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    8

    Add range instead og item to combo in userform

    Hi all,

    I have created a userform that I am going to use to collect some data. By using the following link (http://www.exceltip.com/st/Create_Us...Excel/629.html) I have created this:

    Private Sub UserForm_Activate()
    TextBoxItemName.Value = ""
    With cboCategory
    .AddItem "IT System"
    .AddItem "Personnel"
    .AddItem "ROV"
    .AddItem "ROV Survey Systems"
    .AddItem "ROV Tooling and NDT Systems"
    .AddItem "Vessel"
    .AddItem "Vessel Consumables"
    .AddItem "Vessel Survey Systems"
    End With
    cboCategory.Value = ""
    If cboCategory.Value = "IT System" Then
    CboSubCategory.AddRange ("IT_System")
    If cboCategory.Value = "Personnel" Then
    CboSubCategory.AddRange ("Personnel")
    If cboCategory.Value = "ROV" Then
    CboSubCategory.AddRange ("ROV")
    If cboCategory.Value = "ROV Survey Systems" Then
    CboSubCategory.AddRange ("ROVSurveySystems")
    If cboCategory.Value = "ROV Tooling and NDT Systems" Then
    CboSubCategory.AddRange ("ROVToolingandNDTSystems")
    If cboCategory.Value = "Vessel" Then
    CboSubCategory.AddRange ("Vessel")
    If cboCategory.Value = "Vessel Consumables" Then
    CboSubCategory.AddRange ("VesselConsumables")
    If cboCategory.Value = "Vessel Survey Systems" Then
    CboSubCategory.AddRange ("VesselSurveySystems")
    End If


    CboSubCategory.Value = ""
    TextBoxItemName.Value = ""
    With cboTypeOfAcquisition
    .AddItem "Consumables"
    .AddItem "Employed"
    .AddItem "Hire In"
    .AddItem "Investment"
    .AddItem "Owned"
    End With
    cboTypeOfAcquisition.Value = ""
    With CboCurrency
    .AddItem "BRL"
    .AddItem "DKK"
    .AddItem "EUR"
    .AddItem "GBP"
    .AddItem "MXN"
    .AddItem "NOK"
    .AddItem "SEK"
    End With
    CboCurrency.Value = ""
    TextBoxPurchasingPrice.Value = ""
    End Sub


    With the cboSubCategory I am trying to make it dependent of the choice made in the cboCategory. Can't make this work. Any suggestions?
    Thank you in advance!

    Magnet

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Add range instead og item to combo in userform

    Is this any better. It assumes that the data is on a worksheet called Data

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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