+ Reply to Thread
Results 1 to 5 of 5

Offset Cut/Past Macro

  1. #1
    Registered User
    Join Date
    12-15-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Offset Cut/Past Macro

    I have a data group of 400+ columns wide and 26 row high. Each column represents a set that I would like to separate from the group in order. Each set will be placed in the same column, just below the previous set. So I’m trying to create a macro that would cut the whole data group, except for the 1st set, move it down 27 row, to the left 1 column (to place the next set below the previous set), and paste. This should be repeated (looped) until the last set is place in the single column.

    As you can see I’m trying to figure out the first cut/paste part, haven’t even put the loop command in yet. As this is my second attempt at this type of Macro it is not going so smoothly. Any and all help is much appreciated!!


    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 02-21-2012 at 02:02 PM. Reason: code tags

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Offset Cut/Past Macro

    Please note the forums rules and the requirement to wrap code between code tags for readability,
    I've edited your original post on this occasion, and with 5 posts you should know by now.

    One way..
    Select the upper left hand cell of your data and run the following macro.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-15-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Offset Cut/Past Macro

    Thanks for your response!! Sorry for not knowing the rules about code tags. I will try to use them to best of my abilities from here on out.

    Because I am new to writing VBA macros I am having trouble understanding the meaning and order of the language. I spend the last few hours trying to break down your macro, to get a better understanding of how it works.

    As far as your macro performing the cut/past task that would make life easier for me, it needs one little tweak. It needs to paste 18 rows below the last paste, not the next row. I tried to adjust your macro to do this by replacing Cells(2, 1) with Cells(18, 1). As you probably know, while this pastes the 1st set of data 18 rows down, it also pastes all other sets in the same place. I tried several other adjustments, but the more I played with it the worst I made it.
    Thanks for your help

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Offset Cut/Past Macro

    Hi,

    Untested, but you could try replacing
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Regards

  5. #5
    Registered User
    Join Date
    12-15-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Offset Cut/Past Macro

    Thanks again!! That replacement line works!

+ 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