split data across columns if the data is in one column only

anillinda

New Member
Joined
Apr 20, 2012
Messages
48
My data is in one column as follows:
NAME
DATE OF BIRTH
HIRE DATE
TERMINATION DATE
NAME
DATE OF BIRTH
HIRE DATE
TERMINATION DATE
NAME
DATE OF BIRTH
HIRE DATE
TERMINATION DATE

I need the name in one column and the date of birth in next column followed with hire date and termination date. How can I do this? I have over 3000 records.
Thanks
Neal
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
compile error: variable not defined
All that remained was to declare the variable f

Code:
Sub test4()
    Dim lr As Long, i As Long, [COLOR=#0000ff]f as range[/COLOR]
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        Set f = Range("A" & i & ":A" & lr).Find("Emp Type: Full time", LookIn:=xlValues, lookat:=xlPart)
        If Not f Is Nothing Then
            Range("B" & Rows.Count).End(xlUp)(2).Resize(1, f.Row - i).Value = WorksheetFunction.Transpose(Range("A" & i, Cells(f.Row, "A")).Value)
            i = f.Row
        End If
    Next
End Sub
 
Upvote 0
Here is a link to a file generated based upon your data that I have transformed using Power Query. Note that because your data is inconsistent in the number of records per person there is a slight hiccup in the transformation. This can be resolved using the same number of records per person. It appears that there is a salary field for one person but not the other.

https://app.box.com/s/ddz4ey8ond3uhu3zq1et5gays946m82v
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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