parsing data

  • Thread starter Thread starter leovh
  • Start date Start date
L

leovh

I import team performance data. The teams may have 12 players but jersey
numbers may run from 1 to 20. The numbers are not sorted..

In a simplified way I receive data as under B and would like to have them
parsed as under C There will be at least 6 matches and four teams at
different sheets.Could this be done with a scrpt.

A B C

1 1 1

2 4 -

3 3 3

4 4

etc

20

1 1 1
 
This may be a start:

Sub zParse()
Dim iRowA&, iRowZ&, iRowV&, s1$, zCell As Range
With ActiveSheet
iRowA = 2
iRowZ = .UsedRange.SpecialCells(xlCellTypeLastCell).Row
Range(Cells(2, 3), Cells(iRowZ, 3)) = "'-"
For iRowV = 2 To iRowZ
s1 = .Cells(iRowV, 2)
Set zCell = .Columns(1).Find(s1, , xlValues, xlWhole)
If Not zCell Is Nothing Then
.Cells(zCell.Row, 3) = s1
End If
Next iRowV
End With
End Sub ' Dave D-C
.. four teams at different sheets ..
If this works, you could do it for other sheets.
 
Probably better is a sheet solution:
in C2, put
=IF(ISNA(MATCH(A2,B:B,FALSE)),"-",A2)
and copy down.

Dave D-C said:
This may be a start:
Sub zParse() [deleted]

leovh said:
I import team performance data. The teams may have 12 players but jersey
numbers may run from 1 to 20. The numbers are not sorted..

In a simplified way I receive data as under B and would like to have them
parsed as under C There will be at least 6 matches and four teams at
different sheets.Could this be done with a scrpt.

A B C
1 1 1
2 4 -
3 3 3
4 4
etc
20
what's this?
1 1 1
 
Thank you Dave for help, the sheet looks as more intersting solution. The
cells to rthe right however are taken by the player performance data.
Manually therfore I insert or delete blank rows to solve the problemm.



Dave D-C said:
Probably better is a sheet solution:
in C2, put
=IF(ISNA(MATCH(A2,B:B,FALSE)),"-",A2)
and copy down.

Dave D-C said:
This may be a start:
Sub zParse() [deleted]

leovh said:
I import team performance data. The teams may have 12 players but jersey
numbers may run from 1 to 20. The numbers are not sorted..

In a simplified way I receive data as under B and would like to have
them
parsed as under C There will be at least 6 matches and four teams at
different sheets.Could this be done with a scrpt.

A B C
1 1 1
2 4 -
3 3 3
4 4
etc
20
what's this?
1 1 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top