+ Reply to Thread
Results 1 to 9 of 9

Macro for List Cut - Paste and Repeat

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Macro for List Cut - Paste and Repeat

    I have looked through prior threads but cannont find my issue...
    I have a long list of 2 column data...


    Every nth row I wish to cut x cells and paste y cells up and over, then delete the rows where the data came from.. See Example Below.. this should loop until there are blank cells. Any help is appreciated



    M Cowe
    L Cow
    M Cox
    P Cox
    S Cox
    C Clark

    to

    M Cowe P Cox
    L Cow M Cox
    M Cox C Clark
    Last edited by Water Doc; 04-16-2009 at 01:31 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for List Cut - Paste and Repeat

    Give this macro a try:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-16-2009 at 03:22 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Macro for List Cut - Paste and Repeat

    Thank you for the reply. I have been trying to modify the code, however having difficulty so I will try to explain exactally what i need....
    I Have two columns of data In
    Column A Column B
    Rows 1-100

    And lets assume there is 20 rows per page

    Lets say after 20 rows of data (1-20) I need the next 20 rows to be placed into Column F and Column G (rows 21 - 40)

    Then then rows 21 - 40 to be deleted and the process start over so there will be 5 pages, consisting of 4 colums of data.


    Thank you again for your assistance.
    Last edited by Water Doc; 04-16-2009 at 04:22 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for List Cut - Paste and Repeat

    Let's not assume anything. When you ask a question as specific as your first, you get a specific macro. If your need is actually DIFFERENT, that's just more unnecessary work.

    Ok, 20 rows at a time?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Macro for List Cut - Paste and Repeat

    You are right, and I apologize, however I wish to learn the code and apply it to any case I may have in the future, rather than asking for help every time. Thanks for your help.

  6. #6
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Macro for List Cut - Paste and Repeat

    when using this macro for long sets of data it will remove only the data in column A as I stated in my reply

    I Have two columns of data

    Column A and Column B
    Using Rows 1-100

    Is is necessary to have 20 rows per page

    After 20 rows of data (1-20 in column A and B) I need the next 20 rows to be placed into Column F and Column G (rows 21 - 40) into rows 1-20

    Then then rows 21 - 40 to be deleted and the process start over so there will be 5 pages, consisting of 4 colums of data.

    Page 1 Data from rows 1-40
    Page 2 Data from rows 41-60

    ect.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for List Cut - Paste and Repeat

    Ok, another shot. 100 rows doesn't parse into sets of 40, so I adjusted it to sets of 20 (10 paired sets of data moved to new column at a time.)

    This macro at least shows you another way to delete the blanks.
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Macro for List Cut - Paste and Repeat

    I'll give it a shot

    Please Login or Register  to view this content.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for List Cut - Paste and Repeat

    Quote Originally Posted by slx View Post
    I'll give it a shot

    [code]
    Hehe, nope, but that was fun to watch...looked snakes pulling data around the sheet.

+ 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