#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default check

hi,

i found the following:

' Validate a URL
' Example: MessageBox.Show(IsValidUrl("http://www.vb2themax.com"))

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
"(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")
End Function

but im not sure how to use it or adapt it for my vba. can someone help?

thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default check

All ISValidURL does is returns either a true or False response.
URL = "http://www.vb2themax.com"
if IsValidUrl(URL) = True then
'enter your code here
Else
msgbox("Invalid URL")
end if

"geebee" wrote:

hi,

i found the following:

' Validate a URL
' Example: MessageBox.Show(IsValidUrl("http://www.vb2themax.com"))

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
"(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")
End Function

but im not sure how to use it or adapt it for my vba. can someone help?

thanks in advance,
geebee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default check

hi,

i am pasting the folloowing function into VBA but getting an error message:

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")"
End Function

not sure what to do... looks like it is not recognizing the "return system"
part

thanks in advance,
geebee


"Joel" wrote:

All ISValidURL does is returns either a true or False response.
URL = "http://www.vb2themax.com"
if IsValidUrl(URL) = True then
'enter your code here
Else
msgbox("Invalid URL")
end if

"geebee" wrote:

hi,

i found the following:

' Validate a URL
' Example: MessageBox.Show(IsValidUrl("http://www.vb2themax.com"))

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
"(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")
End Function

but im not sure how to use it or adapt it for my vba. can someone help?

thanks in advance,
geebee

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default check

The like operator should work but doesn't give the correct results on my PC

Function IsValidUrl(ByVal URL As String) As Boolean
IsValidUrl = URL Like "(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?"
End Function


"geebee" wrote:

hi,

i am pasting the folloowing function into VBA but getting an error message:

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")"
End Function

not sure what to do... looks like it is not recognizing the "return system"
part

thanks in advance,
geebee


"Joel" wrote:

All ISValidURL does is returns either a true or False response.
URL = "http://www.vb2themax.com"
if IsValidUrl(URL) = True then
'enter your code here
Else
msgbox("Invalid URL")
end if

"geebee" wrote:

hi,

i found the following:

' Validate a URL
' Example: MessageBox.Show(IsValidUrl("http://www.vb2themax.com"))

Function IsValidUrl(ByVal url As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(url, _
"(http|ftp|https)://([\w-]+\.)+(/[\w- ./?%&=]*)?")
End Function

but im not sure how to use it or adapt it for my vba. can someone help?

thanks in advance,
geebee

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and move check box (check boxes) with new cell link? Marty Excel Worksheet Functions 1 January 20th 10 07:43 PM
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM


All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"