+ Reply to Thread
Results 1 to 6 of 6

names from a list

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    names from a list

    Hi, i have a list of names in a sheet called "names"; is it possible to write something which will pick 2 random names from the list and join them together in a cell "name 1 and name2" for example ?

    Thanks for your help
    Tinkerbelle

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Tinkerbelle,

    Try this function.
    Please Login or Register  to view this content.
    Copy and paste the function into a standard module. In a cell on your worksheet you will put "=RandomName(starting row, ending row)". This will get you "random name 1 and random name 2" in that cell. This function assumes that your name list is in Col A. You can copy and paste to different cells to get a list of random names.

    Give it a try and let me know what happens.
    Sincerely,
    Jeff

  3. #3
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201
    Thanks Jeff, this works well, but with a small problem.
    Can it be changed so that it recalculates on the F9 key ?
    So the 2 word random phrase changes everytime you press the F9 key?

    Hope that isnt too difficult.
    Thanks
    Tinkerbelle

  4. #4
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Tinkerbelle,

    Add
    Please Login or Register  to view this content.
    right after the Dim statements.

    Where ever you have used the function delete it and put it in again. This will cause the change to take effect. After that each time you press F9 your list should change. The only drawback is that anytime you change anything on the sheet your list is going to change. The F9 key is just forcing this to happen when you haven't actually changed anything.

    Hope this is what you are needing.

  5. #5
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201
    Thank you Jeff, just what I was after.

  6. #6
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Tinkerbelle,

    Glad of could be of help! It was certainly my pleasure!

+ 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