Assuming you can better define the actual pattern you want to use, something like this:
I'm going to assume the pattern is
Uppercase letter B
followed by 1 or more digits
followed by uppercase letter A
followed by 1 or more digits.
And that you can
guarantee it occurs only once in any filename.
Function SortMidName (name as String) As String
Dim rgx As New Regex("(B\d+A\d+)")
Dim match As Match = rgx.Match(name)
If match.Success Then
Return match.Groups(1).Value
End If
Return String.Empty
End Function
files = New DirectoryInfo(My.Settings("Store" && clickedTbNumber)).GetFiles().OrderBy(Function(f As FileInfo) SortMidName(f.Name))
Take the above with a grain of salt... my VB is pretty weak (my c# on the other hand!)