OK, apologies for it being a bit crude but it's getting late here and I need to
turn in. There is no error checking in this so run it on a COPY of your data.
It assumes the following:-
All your data is in Col A
There are no headers or anything and your data all starts in A2, ie the first
name is in A2, and that *A1 IS BLANK* - (Haven't got any error checking to
bypass you having data in A1 and there not being a blank row before it - It will
error out)
Assumes as per your example, the *only* time there is a cell with data in it,
and a blank above it is when you start a new record.
Now just run this against it:-
Sub Cleandata()
Dim Offs As Long
Dim Incr As Long
Dim Lrow As Long
Lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Offs = 0
Incr = 0
For x = 2 To Lrow
With Cells(x, 1)
If .Value <> "" And .Offset(-1, 0).Value = "" Then
Incr = Incr + 1
Offs = 0
.Copy Cells(Incr, 3)
Else: Offs = Offs + 1
.Copy Cells(Incr, 3 + Offs)
End If
End With
Next x
End Sub
To do this, hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane. Within this pane you
need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it. Within
that you should see the following:-
VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
If you have named your sheets then those names will appear in the brackets above
as opposed to
what you see at the moment in my note.
Right click on the VBA(Project) bit and choose Insert Module - It will now look
like this and a big white space should just have appeared in front of you.
VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
Modules
Module1
Paste the code I gave you into the white space. Then hit File / Close and
return to Microsoft Excel and save the file. Now just hit Tools / Macro /
Macros / CleanData
When done, just check your data and then delete Col A/B