Results 1 to 4 of 4

HELP splitting out text in one cell into many rows quickly

Threaded View

  1. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,878

    Re: HELP splitting out text in one cell into many rows quickly

    Option Explicit
    
    Sub demo()
    Dim a, b
    Dim i As Long, j As Long, k As Long, n As Long, lr As Long
    Dim t() As String
    With Sheets("Sheet1")
        lr = .Cells(Rows.Count, "A").End(xlUp).Row
        a = .Range("A13:O" & lr)
        ReDim b(1 To 15, 1 To 10000)
        n = 0
        For i = 1 To UBound(a, 1)
            t = Split(a(i, 15), Chr(10) & Chr(10))
            For j = 0 To UBound(t, 1)
                n = n + 1
                b(15, n) = t(j)
                For k = 1 To 14
                    b(k, n) = a(i, k)
                Next k
            Next j
        Next i
    End With
    
    With Sheets("Sheet2")
        .[A8].Resize(n, 15) = Application.Transpose(b)
        .[A8].Resize(n, 15).HorizontalAlignment = xlCenter
        .[A8].Resize(n, 15).VerticalAlignment = xlCenter
    End With
    End Sub
    Attached Files Attached Files
    Last edited by JohnTopley; 11-06-2024 at 08:43 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Splitting Text Field in to Rows
    By Martin_246 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2022, 10:28 AM
  2. [SOLVED] Highlighting every next rows after a row containing specific text and splitting rows
    By Khalid.Noor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-24-2018, 04:44 AM
  3. Splitting dates and inserting rows quickly
    By ola7mat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2017, 12:27 PM
  4. Quickly edit text of a hyperlinked cell?
    By so57x in forum Excel General
    Replies: 1
    Last Post: 01-26-2017, 02:21 PM
  5. splitting text into rows.
    By rose9812in in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-14-2015, 09:44 AM
  6. Macro splitting comma delimated cell text into rows with other row data copied...
    By geoffffffff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2013, 11:07 AM
  7. [SOLVED] Splitting text from one cell into separate text fragments, Located in adjacent cells
    By onsid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2013, 08:32 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