+ Reply to Thread
Results 1 to 4 of 4

Concatenate Text in Column B Split in Multiple Rows for Each Number in Column A

Hybrid View

zaska Concatenate Text in Column B... 09-23-2020, 02:33 AM
Sintek Re: Concatenate Text in ... 09-23-2020, 03:33 AM
zaska Re: Concatenate Text in ... 09-23-2020, 03:47 AM
Sintek Re: Concatenate Text in ... 09-23-2020, 03:51 AM
  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    Concatenate Text in Column B Split in Multiple Rows for Each Number in Column A

    Dear Seniors,

    I want to Concatenate the Text in Column "B" which is split across several rows, I want to do this for Each Number in Column




    Thank you
    Last edited by zaska; 09-23-2020 at 05:25 AM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    O365 V2408
    Posts
    15,202

    Re: Concatenate Text in Column B Split in Multiple Rows for Each Number in Column A

    For this scenario...
    Sub sintek()
    With Range("E1:E" & Cells(Rows.Count, 1).End(xlUp).Row)
        .Formula = "=IF(A1="""","""",IF(A2<>"""",B1,B1&"" ""&B2))"
        .Value = .Value
        .SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
    End With
    End Sub

    If there is more than 1 blank row between data...
    Sub sintek()
    Dim Data, Temp, i As Long, ii As Long
    Data = Cells(1).CurrentRegion.Value
    ReDim Temp(1 To UBound(Data))
    For i = LBound(Data) To UBound(Data)
        If Data(i, 1) <> "" Then
            ii = ii + 1
            Temp(ii) = Data(i, 2)
        Else
            Temp(ii) = Temp(ii) & " " & Data(i, 2)
        End If
    Next i
    Range("E1").Resize(ii) = Application.Transpose(Temp)
    End Sub
    Last edited by Sintek; 09-23-2020 at 03:39 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    06-20-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    454

    Re: Concatenate Text in Column B Split in Multiple Rows for Each Number in Column A

    Thank you so much. It helped me a lot.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    O365 V2408
    Posts
    15,202

    Re: Concatenate Text in Column B Split in Multiple Rows for Each Number in Column A

    .........................
    THANKS.gif

+ 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 concatenate Single Column which is split into Multiple Rows between two dates
    By zaska in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2020, 10:21 AM
  2. Split column into multiple rows
    By lafm5970 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2019, 04:02 PM
  3. [SOLVED] Split 1 long column into multiple columns with dynamic number of rows
    By Bax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2018, 06:46 AM
  4. [SOLVED] split text/number column into 2 columns
    By mb1074 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2013, 04:42 PM
  5. Concatenate multiple rows based on column value
    By sbartlett1123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2012, 05:58 PM
  6. [SOLVED] How to Concatenate multiple Rows into 1 Column cell
    By rbapdx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-11-2012, 12:02 AM
  7. [SOLVED] Need to split one long column into multiple rows
    By agbiggs@hotmail.com in forum Excel General
    Replies: 2
    Last Post: 03-07-2006, 04:46 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