• Strangeness in Excel 2000 VBA

    Author
    Topic
    #357473

    I’ve got a little routine that populates comboboxes on a userform from a named range.

    Dim cboBox as combobox
    Dim rngRange as Range

    Set cboBox = combobox1
    Set rngRange = Range(“Stuff”)
    Call LoadComboBox(rngRange, cboBox)

    Anyway the above works just fine. When I try to do it using ListBoxes

    Dim lstBox as ListBox
    Dim rngRange as Range

    Set lstBox = ListBox1

    I get a type mismatch error. I can get it to work Dimming lstBox as an object or control. Why does it work using comboxes but not listboxes? As I have a work-around, this isn’t urgent. It’s just strange. Anyone have any ideas? confused

    Oh, I’m using Excel 2000 SP1

    Viewing 1 reply thread
    Author
    Replies
    • #531105

      Just a crazy thought…

      What happens if you

      Dim lstBox as Userform.Listbox

    • #531110

      I’m not worthy exclamation I’m not worthy exclamation bow

      That did the trick! MSForms.ListBox!

      Thanks Rob & Kevin(Hey, you were close.)

    Viewing 1 reply thread
    Reply To: Strangeness in Excel 2000 VBA

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: