
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
'---------------------------------------------------------------------------------------
' Procedure : MatchTeam
' Author : scossa
'---------------------------------------------------------------------------------------
'
Function MatchTeam(ByVal sMatch As String) As Variant
Dim nLR As Long
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
sTeam = aTeam(j, 1)
If InStr(1, sTeam, sMatch, vbTextCompare) > 0 Then
dictTeam(sTeam) = dictTeam(sTeam)
End If
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Function MatchTeam(ByVal sMatch As String) As Variant
Dim nLR As Long
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Dim Stato As Boolean
Set rng = Foglio1.UsedRange.Columns("C")
Dim sn
sn = Split(sMatch, " ")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
Stato = True
On Error Resume Next
For j = 1 To UBound(aTeam)
sTeam = aTeam(j, 1)
If InStr(1, sTeam, sn(0), vbTextCompare) > 0 Then
Else
Stato = False
End If
If InStr(1, sTeam, sn(1), vbTextCompare) > 0 Then
Else
Stato = False
End If
If InStr(1, sTeam, sn(2), vbTextCompare) > 0 Then
Else
Stato = False
End If
If Stato = True Then dictTeam(sTeam) = dictTeam(sTeam)
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
'---------------------------------------------------------------------------------------
' Procedure : MatchTeam
' Author : scossa
' Date : 25/05/2014
' Purpose :
'---------------------------------------------------------------------------------------
'
Function MatchTeam(ByVal sMatch As String) As Variant
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
sTeam = " " & aTeam(j, 1) 'match solo a inizio parole
If InStr(1, sTeam, " " & sMatch, vbTextCompare) > 0 Then
dictTeam(sTeam) = dictTeam(sTeam)
End If
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function
|
Function MatchTeam(ByVal sMatch As String) As Variant
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Dim Sn, k, x0, tx
Dim stato As Boolean
With CreateObject("scripting.dictionary")
Sn = Split(sMatch, " ")
For k = 0 To UBound(Sn)
x0 = .Item(Sn(k))
Next
End With
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
stato = True
For Each tx In Sn
sTeam = " " & aTeam(j, 1) 'match solo a inizio parole
If InStr(1, sTeam, " " & tx, vbTextCompare) > 0 Then
Else
stato = False
End If
Next tx
If stato = True Then dictTeam(sTeam) = dictTeam(sTeam)
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function
|
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
'---------------------------------------------------------------------------------------
' Procedure : MatchTeam
' Author : scossa
' Date : 25/05/2014
' Purpose :
'---------------------------------------------------------------------------------------
'
Function MatchTeam(ByVal sMatch As String) As Variant
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Dim Sn, k, x0, tx
Dim stato As Boolean
Sn = Split(sMatch, " ")
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
stato = True
For Each tx In Sn
sTeam = " " & aTeam(j, 1) 'match solo a inizio parole
If InStr(1, sTeam, " " & tx, vbTextCompare) = 0 Then
stato = False
End If
Next tx
If stato = True Then dictTeam(sTeam) = dictTeam(sTeam)
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function
|
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
'---------------------------------------------------------------------------------------
' Procedure : MatchTeam
' Author : scossa
' Date : 25/05/2014
' Purpose :
'---------------------------------------------------------------------------------------
'
Function MatchTeam(ByVal sMatch As String) As Variant
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Dim Sn As Variant
Dim tx As Variant
Dim stato As Boolean
Sn = Split(sMatch, " ")
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
stato = True
For Each tx In Sn
sTeam = " " & aTeam(j, 1) 'match solo a inizio parole
If InStr(1, sTeam, " " & tx, vbTextCompare) = 0 Then
stato = False
End If
Next tx
If stato = True Then dictTeam(sTeam) = dictTeam(sTeam)
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function
|
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
'---------------------------------------------------------------------------------------
' Procedure : MatchTeam
' Author : scossa
' Date : 25/05/2014
' Purpose :
'---------------------------------------------------------------------------------------
'
Function MatchTeam(ByVal sMatch As String) As Variant
Dim dictTeam As Object
Dim rng As Range
Dim aTeam As Variant
Dim j As Long
Dim sTeam As String
Dim Sn As Variant
Dim tx As Variant
Dim stato As Boolean
Sn = Split(sMatch, " ")
Set rng = Foglio1.UsedRange.Columns("C")
Set dictTeam = CreateObject("scripting.dictionary")
aTeam = Intersect(rng, rng.Offset(3, 0))
For j = 1 To UBound(aTeam)
stato = True
For Each tx In Sn
sTeam = " " & aTeam(j, 1) 'match solo a inizio parole
If InStr(1, sTeam, " " & tx, vbTextCompare) = 0 Then
stato = False
Exit For
End If
Next tx
If stato = True Then dictTeam(sTeam) = dictTeam(sTeam)
Next
MatchTeam = dictTeam.Keys
Set rng = Nothing
Set dictTeam = Nothing
End Function
|
