Split cell content into multiple rows, retaining adjeacent cell data

fmassa81

New Member
Joined
Aug 7, 2013
Messages
1
Folks,

This is my first time posting :eek: and am really grateful for any help with my puzzle!

I'm working on a project where I have to count author publications across several academic journals. I have downloaded and organized all the data for these journals, but have been struggling to parse things out for an easy count.

I've been searching the forum for a straightforward way to split semi-colon delimited author names for a single article, create one row per co-author name and carry over the article details to the newly created rows.

My data looks something like this (except that rows continue all the way to column BD):

AuthorsNumber of AuthorsTitlePeriodical
Åstebro,Thomas;Bernhardt,Irwin

<tbody>
</tbody>
2The Winner's Curse of Human CapitalSmall Business Economics
Åstebro,Thomas1
Basic Statistics on the Success

<tbody>
</tbody>
Entrepreneurship: Theory & Practice
Demircan;Erturk,Alper2Technological ChangeSmall Business Economics

<tbody>
</tbody>


I would like the data to look like this:


AuthorsNumber of AuthorsTitlePeriodical
Åstebro,Thomas

<tbody>
</tbody>
2The Winner's Curse of Human CapitalSmall Business Economics
Bernhardt,Irwin2The Winner's Curse of Human CapitalSmall Business Economics
Åstebro,Thomas1
Basic Statistics on the Success

<tbody>
</tbody>
Entrepreneurship: Theory & Practice
Demircan;2Technological ChangeSmall Business Economics
Erturk,Alper2Technological ChangeSmall Business Economics

<tbody>
</tbody>


In short, the author cells are split into multiple rows and all the adjacent data about the articles they co-authored up to Column BD gets carried over to the newly created row. There are a total of 7180 rows in my worksheet. My version of Excel is 2010.

Thank you advance for your help!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
the data is in sheet1 as follows

Excel Workbook
ABCD
1AuthorsNumber of AuthorsTitlePeriodical
2stebro,Thomas;Bernhardt,Irwin2The Winner's Curse of Human CapitalSmall Business Economics
3stebro,Thomas1Basic Statistics on the SuccessEntrepreneurship: Theory & Practice
4Demircan;Erturk,Alper2Technological ChangeSmall Business Economics
Sheet1



run tis macro and see sheet3

Code:
Dim r1 As Range, c1 As Range, dest As Range, k As Integer, j As Integer
Dim destr As Range
Sub test()
Set r1 = Range(Range("A2"), Range("A2").End(xlDown))
Set dest = Range("A1").End(xlDown).Offset(5, 0)




With Worksheets("sheet3")
.Cells.Clear
End With
Worksheets("sheet1").Activate




For Each c1 In r1
c1.TextToColumns Destination:=dest, DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
j = Cells(dest.Row, Columns.Count).End(xlToLeft).Column
'MsgBox j
For k = 1 To j


dest.Offset(0, k - 1).Copy
With Worksheets("sheet3")
Set destr = .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
destr.PasteSpecial
End With
Range(c1.Offset(0, 1), c1.End(xlToRight)).Copy
With Worksheets("sheet3")
destr.Offset(0, 1).PasteSpecial
End With


Next k


dest.EntireRow.Cells.Clear
nextc1:
Next c1
With Worksheets("sheet3")
Range(Range("A1"), Range("A1").End(xlToRight)).EntireColumn.AutoFit
End With
MsgBox "macro over"
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,190
Messages
6,129,422
Members
449,509
Latest member
ajbooisen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top