+ Reply to Thread
Results 1 to 4 of 4

select listbox item automatically

  1. #1
    Forum Contributor
    Join Date
    06-02-2005
    Location
    India
    MS-Off Ver
    2007
    Posts
    138

    Question select listbox item automatically

    I hv 2 listboxes on userform..

    If user is selecting the text of listbox1 then
    get its index and select the text of listbox2(index of listbox1)
    next also remove the selected item from both listboxes on clicking remove btn.

  2. #2
    Bob Phillips
    Guest

    Re: select listbox item automatically

    Private Sub cmdRemove_Click()
    Range("A1").Offset(ListBox1.ListIndex).Delete
    Range("B1").Offset(ListBox1.ListIndex).Delete
    End Sub

    Private Sub ListBox1_Click()
    ListBox2.ListIndex = ListBox1.ListIndex
    End Sub

    This assumes that the source of the listboxes is A1:A10, B1:B10

    --
    HTH

    Bob Phillips

    "ilyaskazi" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I hv 2 listboxes on userform..
    >
    > If user is selecting the text of listbox1 then
    > get its index and select the text of listbox2(index of listbox1)
    > next also remove the selected item from both listboxes on clicking
    > remove btn.
    >
    >
    > --
    > ilyaskazi
    > ------------------------------------------------------------------------
    > ilyaskazi's Profile:

    http://www.excelforum.com/member.php...o&userid=23969
    > View this thread: http://www.excelforum.com/showthread...hreadid=467414
    >




  3. #3
    Forum Contributor
    Join Date
    06-02-2005
    Location
    India
    MS-Off Ver
    2007
    Posts
    138

    Thumbs up

    Although i wanted the help for userform's listbox, it is solved taking some similar codes

    It is perfect as always, Mr Bob.. Thankyou.

  4. #4
    Forum Contributor
    Join Date
    06-02-2005
    Location
    India
    MS-Off Ver
    2007
    Posts
    138

    Question well 1 more thing with listbox...

    i do not want to accept any item in listbox if it is already existing

    show msgbox of already exist

+ 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