+ Reply to Thread
Results 1 to 19 of 19

Move data from Column A-E or B-F to columns G-K

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Move data from Column A-E or B-F to columns G-K

    HI,
    I want to move couple of data from columns A-E or B-F to G-K. How do I do this. I have 27000 records in the excel and the requirement is : See the sample excel attached. In the attached excel the correct format for sub rows is Row 3. I need to move Row 5-13 to Columns G-K,Row 15 to columns G-K,Row 17-22 to columns G-K and so on. The row with the number which is 10digits will not move.(Like Row 1,4,14,16). Is there any macro for this type of issues or what is the best way to deal as I have 27000 reocords similarly. Good thing is I have constant columns.

    Thanks
    NewBie
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    813

    Re: Move data from Column A-E or B-F to columns G-K

    Hi netnewbie,
    Please try the sample in attached for now and wait for better code from experts:

    Regards,
    tt3
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    Hi,
    When I ran your macro yes it copies but I also want to delete the old ones after moving. Same as cut paste. I want to delete the data from column A to E,F after the data is moved to columns G-K.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    That's what happened when I ran it on your sample.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Move data from Column A-E or B-F to columns G-K

    Another option.
    The code will run slow on large data, but because of the cut method, it is unavoidable.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    Quote Originally Posted by netnewbie View Post
    Hi,
    When I ran your macro yes it copies but I also want to delete the old ones after moving. Same as cut paste. I want to delete the data from column A to E,F after the data is moved to columns G-K.
    Oh now I see. I think you were replying to the code in Post#2.

  8. #8
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    I tried your macro on the real file but it did not work. It says subscript out of range. It runs on the small file. What is the difference. Please see the attached real big file.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    John Davis code works too on small file but why is it not working on the large file. Please see the attachment macrotesting which is the real big file.
    Last edited by netnewbie; 09-23-2013 at 02:17 PM. Reason: modified

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    3 People have offered you suggestions. Who's macro are you referring too?

  11. #11
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    Try:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    Thanks John. I ran your code and it does cut and paste all the data. Only problem its removing the data for the rows which has CaseNumber. Can you run it and see for yourself.For the ones which has CaseNumber it should not delete or move.

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Move data from Column A-E or B-F to columns G-K

    Do you mean?

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    Sub cutme() did not work. It actually deleted all the rows and did not paste. Also if it has casenumber it had overwritten the values. Actually if it has casenumber it should not do anything.
    If Len(cell) < 10 And Len(cell) Then
    I understood if Len < 10 do something but when it says and Len(cell) what is the purpose of it.

  15. #15
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    Okay, try.

    Please Login or Register  to view this content.

  16. #16
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Move data from Column A-E or B-F to columns G-K

    I do not know which sheet you are referring to, but the code correctly cuts if column B is not a number. The code is slow anyway with 4k rows, so I would not imagine how long will take to run with 27k. I am out of the loop.

  17. #17
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    Great! It works. Thanks all of you for your help. John Davis code works perfect.

  18. #18
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Move data from Column A-E or B-F to columns G-K

    You're welcome. Glad to help out, and thanks for the feedback. Please comply with Forum Rule No. 9 and mark this thread as solved.

  19. #19
    Registered User
    Join Date
    09-19-2013
    Location
    DC
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Move data from Column A-E or B-F to columns G-K

    Hi John,
    I had another similar issue. Can you help me please. Please look at the thread "Cut the data from column A to K and past it in columns B to L". I highly appretiate your help.

+ 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] How to move one Column's data to other Columns...
    By LeoThe Lion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-25-2012, 05:11 AM
  2. Help needed about move one Column data to other Columns...
    By LeoThe Lion in forum Excel General
    Replies: 1
    Last Post: 06-25-2012, 03:22 AM
  3. Move data to new columns when cell in Column A is blank
    By MrClaw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2010, 12:51 PM
  4. How do i move data series into other columns on column charts
    By JamesO in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-03-2006, 12:50 PM
  5. Move Data from one column to many columns
    By Barb in forum Excel General
    Replies: 3
    Last Post: 01-16-2006, 01:00 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