Consulting

Results 1 to 8 of 8

Thread: Combobox ListFillRange

  1. #1
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location

    Combobox ListFillRange

    Comboboxes were created in the Worksheets. I am trying to use a ListFillRange IN Combobox2 when Combox1.value is true but gives me "Unspecified Error"

    [vba]
    Private Sub cmbRest1_Change()
    If cmbRest1.Value = "BK-KSA" Then 'combox1
    With cmbBrand1 'combobox2
    .Clear
    .ListFillRange = Sheets("SOURCE").Range("D423").Value 'or can I use .AddItem?


    End With
    End If


    End Sub

    [/vba]
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub cmbRest1_Change()
    If cmbRest1.Value = "BK-KSA" Then 'combox1
    With cmbBrand1 'combobox2
    .Clear
    .ListFillRange = Sheets("SOURCE").Range("D423").Address
    End With
    End If

    End Sub
    [/vba]


    __________________________________________
    UK Cambridge XL Users Conference 29-30 Nov
    http://www.exceluserconference.com/UKEUC.html
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    Same error still pointing to .clear but when i remove this, there was no error bu tno value comes out in the combobox.
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What sort of combo is it, forms or control toolbox?


    __________________________________________
    UK Cambridge XL Users Conference 29-30 Nov
    http://www.exceluserconference.com/UKEUC.html
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    Control ToolBox...
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Of course, you can't use/don't need Clear in a bound combobox.

    Just ditch that line.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Mentor jammer6_9's Avatar
    Joined
    Apr 2007
    Location
    Saudi Arabia
    Posts
    318
    Location
    As i ditch ".clear" line, no error pops in but no value showing in the combobox.
    T-ogether
    E-veryone
    A-chieves
    M-ore


    One who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever.

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Is you sheet range full of data?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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