+ Reply to Thread
Results 1 to 10 of 10

select 365th rows and paste it in another column

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    46

    select 365th rows and paste it in another column

    Dear All

    I have a total of 20805 rows in excel. What I am trying to do is to select first 365 rows and paste in in another column and next 365 rows and paste in another column and so on so that I have 57 columns with each column of 365 rows. I would really appreciate any help thanks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: select 365th rows and paste it in another column

    Try this:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Last edited by alansidman; 04-18-2014 at 09:50 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: select 365th rows and paste it in another column

    Hi,

    Is it a single column (column A) containing 20805 items which you want to move 365 of those to the B column...then another 365 to the C column...etc...?
    Regards,
    Rudi

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: select 365th rows and paste it in another column

    Modified code: Corrected code is in previous thread. Changed the value of i.

  5. #5
    Registered User
    Join Date
    04-11-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: select 365th rows and paste it in another column

    Hi Rudi

    Yes the data is in single column.

    Thanks

  6. #6
    Registered User
    Join Date
    04-11-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: select 365th rows and paste it in another column

    Thanks man for the help. But there appears to be slight problem here. Your vba code is pasting 365, then 366 and then 367 and 368..... number of entries in respective columns. I am sorry I am not very familiar with the VBA code and hence this ignorance

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: select 365th rows and paste it in another column

    I modified the code after I saw that. Use the code that is in the post now. I changed the line

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    and this should solve the problem.

  8. #8
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: select 365th rows and paste it in another column

    Hi,

    Just re-select Alan's code above and copy and replace the code you currently have.
    Alan made a late change to his code that will correct that issue.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: select 365th rows and paste it in another column

    you could try this formula filled acros 57 rows and down 365
    =INDEX($A:$A,ROWS($A$1:A1)+COLUMNS($A$1:A1)*365-365)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  10. #10
    Registered User
    Join Date
    04-11-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: select 365th rows and paste it in another column

    Awsome. It worked like magic. Many thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Select (one) Row where a column has a value in it. Paste one row below it.
    By saturos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2013, 01:09 AM
  2. select, copy, and paste multiple different rows to new sheet
    By prjames3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-10-2013, 12:42 PM
  3. Select the last row in a column with data nd paste the value in the rest of the column
    By Sheldon Brooks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2013, 05:33 AM
  4. [SOLVED] Conditionally Select Rows and paste into a new Sheet
    By jsolder in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-18-2012, 03:11 AM
  5. Select rows with certain values, cut, paste into new worksheet
    By Meltad in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-07-2006, 05:00 AM

Tags for this Thread

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