I have data as below which records players name and number of goals kicked per round. Blanks mean they didnt play the x means they played but didnt kick a goal.
Surname | First | Second | R1 | R2 | R3 | R4 | R5|
Smith | Barry | John | x | | | | 2 |
Jones | Murry | Fred | x | 3 | 2 | 1 | 2 |
Wills | Geoff | Mike | x | | | x | x |
And Need it to display like:
Smith | Barry | John | R1 | x |
Smith | Barry | John | R5 | 2 |
Jones | Murry | Fred | R1 | x |
Jones | Murry | Fred | R2 | 3 |
Jones | Murry | Fred | R3 | 2 |
Jones | Murry | Fred | R4 | 1 |
Jones | Murry | Fred | R5 | 2 |
Wills | Geoff | Mike | R1 | x |
Wills | Geoff | Mike | R4 | x |
Wills | Geoff | Mike | R5 | x |
So far I have this code in VBA
Sub NewLayout()
For i = 2 To Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
For j = 0 To 4
If Cells(i, 4 + j) <> vbNullString Then
intCount = intCount + 1
Cells(i, 1).Copy Destination:=Cells(intCount, 10)
Cells(i, 2).Copy Destination:=Cells(intCount, 11)
Cells(i, 3).Copy Destination:=Cells(intCount, 12)
Cells(i, 4 + j).Copy Destination:=Cells(intCount, 13)
End If
Next j
Next i
End Sub
Which is getting me most of what I need without returning the header row ie R1, R2, R3 etc..