Need a little more assistance in creating a function to split up string.
Ex.
Uncle Grandpa (2013) -2015-06-08- Body Trouble
Green is Series name, they can be:
Uncle Grandpa (2013)
3rd Rock from the Sun
227
Bones
Blue is the "parts like" (look in the vba), they can be:
S##E##
S##E##E##
-####-##-##-
#x#
##x##
Blue Code: Works Great
Red Works Great
I would like to have a Function the get the Green Series name.
Also to be able to add additional info in the array.
Thanks
Ex.
Uncle Grandpa (2013) -2015-06-08- Body Trouble
Green is Series name, they can be:
Uncle Grandpa (2013)
3rd Rock from the Sun
227
Bones
Blue is the "parts like" (look in the vba), they can be:
S##E##
S##E##E##
-####-##-##-
#x#
##x##
Blue Code: Works Great
Code:
Function Episode(DataLine As String) As String
Dim x As Long, Parts() As String
Parts = Split(DataLine)
For x = 0 To UBound(Parts)
If Parts(x) Like "*#x#*" Or Parts(x) Like "S#*E#*" Or Parts(x) Like "-####-##-##-" Then
Episode = Parts(x)
Exit For
End If
Next
End Function
Red Works Great
Code:
Function EpisodeName(DataLine As String) As String
Dim x As Long, AfterEpisode As String, Parts() As String
Parts = Split(DataLine)
For x = 0 To UBound(Parts)
If Parts(x) Like "*#x#*" Or Parts(x) Like "S#*E#*" Or Parts(x) Like "*-####-##-##-*" Then
Parts = Split(DataLine, " ", x + 2)
AfterEpisode = Parts(UBound(Parts))
If InStr(AfterEpisode, ".") Then AfterEpisode = Left(AfterEpisode, InStrRev(AfterEpisode, ".") - 1)
EpisodeName = AfterEpisode
Exit For
End If
Next
End Function
I would like to have a Function the get the Green Series name.
Also to be able to add additional info in the array.
Thanks