Cluster data with VBA

خرید بک لینک

I would like to sort my excel import which contains some data generated from my fantasy sport side. more or less there is a team an players which are playing and not.

My text file that I get (generated by the server) looks like this:

team: Sharks
status: playing
date: 2016/03/11

team: Pans
status: playing
date: 2016/03/11

team: MCU
status: not playing
date: 2016/03/12

There a unlimited amount of teams with there status etc. Special here is that for example that 2 or more teams can play on the same date or not.

What I would like have is instead of 100 of lines of the same thing just something like that, but bear in mind that there are more then on team for example golden states etc..

team Sharks
status:playing
date playing:
2016/03/11
2016/03/11
date not playing:
2016/03/12

What I have so far:

Dim nextPlace As Long
Dim maxRows As Long

Sub walkThePlank()
maxRows = 10000                'UPDATE THIS AS NEEDED
nextPlace = 3

Worksheets("Sheet1").Range("B1").Value = "team:"
Worksheets("Sheet1").Range("B2").Value = "status:"


findData ("status: playing")
addToNextSpace ("Status: Not playing")
findData ("status: not playing")

End Sub

Sub findData(s As String)
Dim i As Long

Dim isPlaying As Boolean
isPlaying = False

For i = 1 To 1000

If isPlaying Then
    addToNextSpace (Worksheets("Sheet1").Range("A" & i).Value)
End If


If LCase(Range("A" & i).Value) = s Then
    isPlaying = True
Else
    isPlaying = False
End If


Next i

End Sub


Sub addToNextSpace(s As String)

Worksheets("Sheet1").Range("B" & nextPlace).Value = s
nextPlace = nextPlace + 1

End Sub

My problem is that with that code can not mange more then one them, and I really dont know how to do that ..

Thanks for help and fast answer

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 188 تاريخ: سه شنبه 18 خرداد 1395 ساعت: 21:08

صفحه بندی