+ Reply to Thread
Results 1 to 4 of 4

list property of listbox

  1. #1
    x taol
    Guest

    list property of listbox



    please see the code below



    sub btn_click()
    'lis == listbox control in userform
    set rng = range("a2:a5")
    lis.list=rng.value 'it's ok
    set rng = range("a2")
    lis.list = rng.value 'it' not ok

    'how can i ??
    'i don't want to use "additem".



    end sub

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Dave Peterson
    Guest

    Re: list property of listbox

    If rng.Cells.Count > 1 Then
    lis.List = rng.Value
    Else
    lis.List = Array(rng.Value)
    End If



    x taol wrote:
    >
    > please see the code below
    >
    > sub btn_click()
    > 'lis == listbox control in userform
    > set rng = range("a2:a5")
    > lis.list=rng.value 'it's ok
    > set rng = range("a2")
    > lis.list = rng.value 'it' not ok
    >
    > 'how can i ??
    > 'i don't want to use "additem".
    >
    > end sub
    >
    > *** Sent via Developersdex http://www.developersdex.com ***


    --

    Dave Peterson

  3. #3
    x taol
    Guest

    Re: list property of listbox


    please is it possible making with one syntex without if statement?

    for example

    lst.List = ~~~~

    *** Sent via Developersdex http://www.developersdex.com ***

  4. #4
    Dave Peterson
    Guest

    Re: list property of listbox

    isn't .list expecting an array?



    x taol wrote:
    >
    > please is it possible making with one syntex without if statement?
    >
    > for example
    >
    > lst.List = ~~~~
    >
    > *** Sent via Developersdex http://www.developersdex.com ***


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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