+ Reply to Thread
Results 1 to 11 of 11

Selecting from one list and adding to another

  1. #1
    Registered User
    Join Date
    11-21-2006
    Posts
    6

    Selecting from one list and adding to another

    Hi,

    Please excuse the fact that I really don't know the correct terminology. I'm new to excel with the exception of some simple calculations.

    I was wondering if someone could show me how to select, via check boxes, from a list of names which are then added to another list.

    I have included an example in a zip file. I just want up to eight names selected from a list on the left to be added to the blank lines on the right.

    Thanks in advance,

    Rod
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    Here you go. You can hide the extra columns I have created - Just left them for you to see.

    I got the code from this site http://www.cpearson.com/excel/noblanks.htm

    I would never attempt this myself!

    Matt
    Attached Files Attached Files

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    I've linked the check boxes to the cell they are in which returns True or False. I've then added a formula in Col C

    =IF(C7=FALSE,"",COUNTIF($C$7:C7,TRUE))

    Next I formatted the cell fonts in Col C and Col D as white

    Then in G7 I added this formula and drag downed

    =IF(ISERROR(INDEX($B$7:$B$25,MATCH(SMALL($D$7:$D$25,ROW(A1)),$D$7:$D$25,0))),"",(INDEX($B$7:$B$25,MATCH(SMALL($D$7:$D$25,ROW(A1)),$D$7:$D$25,0))))

    Attached is an example

    VBA Noob
    Attached Files Attached Files
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    11-21-2006
    Posts
    6
    Thanks very much to the both of you.

    I just discovered this Forum today after trying to figure this out on my own for the last 2 days.

    You have been most helpful....

    I just hope you dont get too sick of me. :-)

    Rod

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Welcome to the forum

    Glad we could help


    VBA Noob

  6. #6
    Registered User
    Join Date
    11-21-2006
    Posts
    6
    It works fantastic.

    There is a similar thing I was trying to do but it turns out to be just different enough that I cant use the previous examples as written.

    I'm trying to catalog some books acording to subject.

    The left most column has a desending list of books by subject...

    Science Fiction 5
    Horror 6
    Comedy 2
    etc.

    Next to each is a cell to input the quantity of each I own.

    To the right is a section of decending blank lines (as in the previous example).

    I want just the books with quantities next to them to appear on the blank lines.

    Again I have included an example. Please dont go out of your way but if you have a chance to check it out that would be fantastic.

    Rod
    Attached Files Attached Files

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try

    VBA Noob
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-21-2006
    Posts
    6
    Wow, that was fast.

    Again, many many thanks.

    Rod

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No Problem

    VBA Noob

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Another way to do this - without helper column - is to use this formula in F5 copied down

    =IF(COUNT(C$5:C$16)>ROW()-ROW(C$5),INDEX(B$5:B$16,SMALL(IF(C$5:C$16<>"",ROW(C$5:C$16)-ROW(C$5)+1),ROW()-ROW(C$5)+1)),"")

    confirmed with CTRL+SHIFT+ENTER

    and then, assuming your entries in column B are unique you can use this formula in I5 copied down

    =IF(F5="","",VLOOKUP(F5,B$5:C$16,2,0))

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thats the way I was after Daddylonglegs

    Thanks man

    VBA Noob

+ 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