[RESOLVED] (string manipulation) grabbing three characters from this link..
Re: (string manipulation) grabbing three characters from this link..
Is this what you mean?
VB Code:
Option Explicit
Private Function Get3Letters(URL As String) As String
Dim lonPos As Long, lonEnd As Long
'Find .com/
lonPos = InStr(1, URL, ".com/", vbTextCompare)
If lonPos > 0 Then
'find next /
lonPos = lonPos + 5
lonEnd = InStr(lonPos, URL, "/")
If lonEnd > 0 Then
Get3Letters = Mid$(URL, lonPos, (lonEnd - lonPos))
End If
End If
End Function
'Test the function.
Private Sub Form_Load()
'http://myssite.com/VFG/1/017/
Dim strTest As String
strTest = "http://myssite.com/VFG/1/017/"
MsgBox Get3Letters(strTest)
End Sub
Re: (string manipulation) grabbing three characters from this link..
You are awesome and that was quick!
Would you happen to have code to output a random number 10 - 50?
Thank you thank you thank you!