+ Reply to Thread
Results 1 to 3 of 3

Move from column to row according to criteria

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Move from column to row according to criteria

    Hello everyone,

    I have attached a worksheet showing what I'm trying to do.

    Basically I need to get/concatenate all the text for all the Name 1's into one cell and the same for Name 2's etc. I have a list of over 3,000 names so i'll just want to be able to drag a formula down.

    I started experimenting with transpose but didn't really know what I was doing. Can anyone help?
    Attached Files Attached Files
    Last edited by D_N_L; 10-23-2012 at 06:35 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Move from column to row according to criteria

    Try this code
    Option Explicit
    
    Sub conc_names()
    Dim i As Long, lrow As Long
    
    Application.ScreenUpdating = False
    
    With Worksheets("Sheet1")
        .Rows(1).Insert
        lrow = .Range("A" & .Rows.Count).End(xlUp).Row
        For i = lrow To 2 Step -1
            If .Range("B" & i).Value = .Range("B" & i - 1).Value Then
                .Range("C" & i - 1).Value = .Range("C" & i - 1).Value & " " & .Range("C" & i).Value
                .Rows(i).Delete
            End If
        Next i
    End With
    
    MsgBox "Concatenation complete"
    
    Application.ScreenUpdating = True
    
    End Sub
    Put it in a standard module.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Move from column to row according to criteria

    Thank you Arlette!!

+ 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