VBA Runtime Error using ListBox Control on Userform

  • Good morning all,


    Can someone please explain to me why it gives me an error in this code



    and particularly this line

    Code
    Controls("textbox" & a + 1) = ListBox1.Column(a)


    it used to work properly....?

  • Re: VBA Runtime Error using ListBox Control on Userform


    Perhaps you could tell us what the error message actually is?

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • Re: VBA Runtime Error using ListBox Control on Userform


    Quote from rory;778594

    Perhaps you could tell us what the error message actually is?



    My apologies. the error is in Dutch.



    Translated it will be something like: Run-time error '-2147352571 (80020005)': Could not set the Value propert.Type mismatch.

  • Re: VBA Runtime Error using ListBox Control on Userform


    How many columns does your Listbox have, and how is it populated?

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • Re: VBA Runtime Error using ListBox Control on Userform


    You have error values in column W on your sheet. Those are causing the error when you try to assign them to the textbox control.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!