+ Reply to Thread
Results 1 to 5 of 5

Copy data contained in several columns into a new column

  1. #1
    Registered User
    Join Date
    04-09-2011
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    2

    Copy data contained in several columns into a new column

    Hello,

    I am attaching a sample spreadsheet to show what I am trying to do. The first worksheet shows the cells that need to be copied and the second worksheet shows how I would like them to look in the end. All the cells that need to be copied start with the same sequence of letters, unique just to the cells that need to be moved, but they are followed with various numbers.

    Is there some formula that could be used to automate the task? The spreadsheet I have is just a simplified example. The actual spreadsheet has a lot more rows and columns. Thanks for help in advance!
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Copy data contained in several columns into a new column

    Hi patka and welcome to the forum,

    Here is the code that does what you ask for and the attached to show it works.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by MarvinP; 04-09-2011 at 11:42 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Copy data contained in several columns into a new column

    If you prefer the original cells to stay populated remove this part of the code:

    Cells(RowCtr, ColCtr).ClearContents
    Last edited by Charlie_Howell; 04-10-2011 at 01:03 PM.

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

    Re: Copy data contained in several columns into a new column

    or use in g2
    =INDEX(A2:F2,MATCH("ms*",A2:F2,0))
    "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

  5. #5
    Registered User
    Join Date
    04-09-2011
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Copy data contained in several columns into a new column

    Thank you all for posting replies. They are all helpful and I will use your suggestions, thank you so much!

+ 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