+ Reply to Thread
Results 1 to 4 of 4

copy selection from listbox1 to listbox2 in userform

  1. #1
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    copy selection from listbox1 to listbox2 in userform

    Hi,

    I started using Userforms and here is one of my problems I encountered...

    I have a problem using Listboxes in a userform. I would like to select one or more rows in listbox1, press a button and then it should copy the selection to listbox2 (I should be able to able to add items by pressing the button)

    Further it would be nice if the Names of the columns would be displayed in listbox1 and listbox2


    It seems simple enough but I cannot find a code that would do that...


    I though there would be something easy such as

    Please Login or Register  to view this content.
    but I just could not find a code like that.

    Listbox1 to Listbox2.xlsm

    regards,

    Decar

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: copy selection from listbox1 to listbox2 in userform

    Hi Decar,
    maybe this example will help you
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: copy selection from listbox1 to listbox2 in userform

    Thank u. Looks good. I will have a look

  4. #4
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: copy selection from listbox1 to listbox2 in userform

    Ok took me a while to understand your code and look up how arrays work. I think I got how it works but here are some questions.


    Please Login or Register  to view this content.
    those are 1 dimensional arrays correct?


    Please Login or Register  to view this content.
    I don't understand those. Why not use
    Please Login or Register  to view this content.
    and in General. Why don't we need "Dim as ...." here? Never seen this before



    Please Login or Register  to view this content.
    Here we add to box2 I get that. But why is it
    Please Login or Register  to view this content.
    and not
    Please Login or Register  to view this content.
    ?


    Maybe these questions are rudimentary but really wanna understand what I'm doing ^^


    regards,
    Decar

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform submit button to load listbox1 and listbox2 selection to same cell
    By wishn4fishn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2013, 03:06 PM
  2. [SOLVED] Populate Listbox2 based on Listbox1 selection
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2013, 09:04 AM
  3. [SOLVED] ListBox2 selection must be based on ListBox1 selection
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2013, 12:23 PM
  4. Populate Listbox2 from Listbox1 selection
    By Macro1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2010, 07:06 AM
  5. Listbox1 to Listbox2?
    By Moretakitty in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-20-2005, 07:06 PM

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