+ Reply to Thread
Results 1 to 6 of 6

Moving cells from one column into multiple columns

  1. #1
    Registered User
    Join Date
    07-23-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    3

    Moving cells from one column into multiple columns

    Hello, all.

    Currently using Excel 2010. I have all the data I need in column A, but I would like to spread it out across different columns.

    To simplify what I'm doing, I would like to go from:
    A1
    A2
    A3
    A4
    A5
    A6
    A7
    A8

    To:
    A1 A2 A3 A4
    A5 A6 A7 A8

    I've been moving the cells individually and then deleting the extra rows, but I would much prefer to use a macro or some other faster method. What I would actually like to do is a bit more than just spreading out all the data, but I figured if someone could at least point me in the right direction with this starting block, I could play with it and hopefully learn to figure it out on my own.

    I appreciate any help you guys can offer! Thanks!

    EDIT: I know I can just transpose using Copy>Paste Special, but then I still have to go through and delete all those rows. I was hoping for something that could consolidate the process a bit and possibly be edited if I need to expand my parameters.
    Last edited by RetroJK; 07-28-2013 at 07:12 PM. Reason: 1st edit: clarification 2nd edit: solved

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Moving cells from one column into multiple columns

    RetroJK,

    Welcome to the Excel Forum.

    With your raw data in worksheet Sheet1, beginning in cell A1 down.

    The below macro will write your results to range C1:F2.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgData macro.


    In the future you may want to describe in detail what you have and what you want, but, attach a sample workbook, so that we can get it right the first time.

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    07-23-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Moving cells from one column into multiple columns

    Stanley,

    Thank you for the response. This works great as a starting block as I can play with it to try and expand the number of columns and rows. Is there a way to run it so that it does it for all rows instead of just a set number of rows? It's ok that it doesn't delete the original content as I can just move the copied content onto a new sheet.

    As requested, I have attached a sample of what I'm working on. I have slimmed it down to just a few examples as well as removed all the images and checkboxes. The only problem with what I'm working on is that the raw data doesn't always match up to how many columns I need in the end, so I figured something basic that at least moved the bulk of the information would be better than nothing.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Moving cells from one column into multiple columns

    RetroJK,

    It is always best to start with the actual raw data (sensitive data changed) - that way a resolution can usually be on the first try.

    With you raw data in worksheet Sheet1, and the results will be in a new worksheet Results.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgDataV2 macro.
    Last edited by stanleydgromjr; 07-24-2013 at 08:26 AM.

  5. #5
    Registered User
    Join Date
    07-23-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Moving cells from one column into multiple columns

    Your code worked perfectly and it's easy to read so I can make simple edits to it very easily. I should have just left it to you from the start like you told me to! So much for my MacGyver approach. haha

    Thanks again!

    Edit: Also, thanks and sorry to whatever mod moved my thread to the correct forum!
    Last edited by RetroJK; 07-28-2013 at 07:19 PM.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Moving cells from one column into multiple columns

    RetroJK,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    And, come back anytime.

+ 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. [SOLVED] Delete multiple empty cells in multiple columns and moving data up, witout Macros
    By CoraF in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:23 AM
  2. Moving multiple cells by relative row/column location
    By alxchang in forum Excel General
    Replies: 4
    Last Post: 09-13-2012, 04:35 PM
  3. Replies: 2
    Last Post: 07-09-2012, 01:44 PM
  4. Moving multiple values from Column A to adjacent columns
    By marker61 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2009, 02:34 AM
  5. Replies: 2
    Last Post: 06-27-2006, 09:20 PM

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