View Full Version : GetStringBetween Help
So I want to get the DOB of my account, but there are like 10 things that have "</td><td>", "</td></tr>" Is there any way to tell it like (5, "</td><td>", "</td></tr>") so it would get the fifth one?
Think outside the box...
Grab a portion of the string that contains the birthdate, then do another getbetween grabbing the birthdate. ;)
Data = GetStringBetween(strHTML, "<b>Date of Birth</b><br>", "</td></tr>")
Data = Replace(Data, "</td><td>", "")
Zachafer
03-21-2012, 04:44 PM
Public Function GetBirthday(strHTML As String) As String
Dim startIndex As Long
startIndex = InStr(1, strHTML, "<b>Date of Birth</b>")
If startIndex = 0 Then
GetBirthday = "Birthday not found"
Else
GetBirthday = Mid$(strHTML, startIndex + 35, 10)
End If
End FunctionIs the most reliable way...
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.