+ Reply to Thread
Results 1 to 7 of 7

Need to take a list of names and expand them so the list shows the same name 5 times...

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Reno, NV
    MS-Off Ver
    Excel 2007
    Posts
    4

    Need to take a list of names and expand them so the list shows the same name 5 times...

    Somewhat hard to explain, but I have a list of names that I need to duplicate 5 times. So, for example, I need to turn this...

    Name
    Abe Lincoln
    George Washington
    George Bush
    Richard Nixon

    Into this...

    Name
    Abe Lincoln
    Abe Lincoln
    Abe Lincoln
    Abe Lincoln
    Abe Lincoln
    George Washington
    George Washington
    George Washington
    George Washington
    George Washington
    George Bush
    George Bush
    George Bush
    George Bush
    George Bush
    Richard Nixon
    Richard Nixon
    Richard Nixon
    Richard Nixon
    Richard Nixon

    The code must be simple, but I'm still fairly new to VBA...

    Thanks,
    Eric

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    Did you want them in the same worksheet (in other words insert rows) or into a new worksheet?

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Reno, NV
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    Yes, I want them to be in the same worksheet. Preferably in the same column, if possible.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    1OneSeven7,

    Welcome to the forum!
    Assuming the names start in A1, give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    07-24-2012
    Location
    Reno, NV
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    Tigeravatar, thanks for the response, but your code doesn't seem to do anything for me. I should have also noted that my names are in column C, starting at cell C2 since I have a title in C1. I tried copying just the names to a new sheet, starting in A1 without a title to test your code, but nothing.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    With the names starting in C2:
    Please Login or Register  to view this content.
    I tested code on and it performed as intended for me

  7. #7
    Registered User
    Join Date
    07-24-2012
    Location
    Reno, NV
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to take a list of names and expand them so the list shows the same name 5 times..

    I think I got it figured out the way I wanted it to work. Here's what I got in case anyone else was having the same problem...

    Please Login or Register  to view this content.
    Please notice that this code assumes your first value is in Cell C2.

+ 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