Created
February 13, 2013 20:02
-
-
Save meganmcchesney/4947699 to your computer and use it in GitHub Desktop.
Lines2Rows Macro breaks apart a cell based on a certain character, then inserts everything that is broken up into separate rows. Run from VBA, "Run Macro"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Lines2Rows() | |
Dim rList As Range, rCell As Range | |
Dim lRow As Long | |
Dim vText As Variant | |
Set rList = Range("B1", Range("B" & Rows.Count).End(xlUp)) ' list | |
lRow = 1 | |
For Each rCell In rList | |
If rCell <> "" Then | |
vText = Split(rCell, ";") | |
Range("H" & lRow).Resize(1 + UBound(vText)).Value = Application.Transpose(vText) | |
lRow = lRow + UBound(vText) + 1 | |
End If | |
Next rCell | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment