Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I use this to split a url, it works fine unless there is a question mark, I have been struggling to set it to split the url if there is a ? in it. can someone please advise
VBA Code:
If InStr(x, "/about") = 0 Then
z = Split(x, "/")
For j = LBound(z) To UBound(z)
If InStr(z(j), "Google.com") Then x = "https://www.Google.com/" & z(j + 1) & "/about": Exit For
Next
End If
If InStr(x, "?") = 0 Then
z = Split(x, "?")
For j = LBound(z) To UBound(z)
If InStr(z(j), "Google.com") Then x = "https://www.Google.com/" & z(j + 1) & "/about": Exit For
Next
End If