Hi guys,
Thanks for taking time in viewing this thread. I would like to ask for your suggestions -- maybe you've got some other way to possibly shorten the code / other method for this simple project of mine.
I am working on a simple project where there is a list of websites and once a website is selected from the list, then it would go to the desired website and here's how I somehow did it:
Here is how it looks like:
Here's the view to the code & worksheet:
Same goes for another project I am up to as well:
Maybe somebody in here would have a way to somehow shorten the codes (I have a list of names where it contains like 50+, and I need to have it in like the directory, imagine the code :O )/ have other ways of doing what I have in mind.
Kind regards,
privxls
Thanks for taking time in viewing this thread. I would like to ask for your suggestions -- maybe you've got some other way to possibly shorten the code / other method for this simple project of mine.
I am working on a simple project where there is a list of websites and once a website is selected from the list, then it would go to the desired website and here's how I somehow did it:
Here is how it looks like:

Here's the view to the code & worksheet:

Code:
Private Sub CommandButton1_Click()
myLinks = ListBox1.Value
Select Case myLinks
Case "360 Safeguard"
WebBrowser1.Navigate2 "360.cn"
Case "AliExpress"
WebBrowser1.Navigate2 "aliexpress.com"
Case "Amazon"
WebBrowser1.Navigate2 "amazon.com"
Case "Apple Inc."
WebBrowser1.Navigate2 "apple.com"
Case "Baidu"
WebBrowser1.Navigate2 "baidu.com"
Case Blogspot
WebBrowser1.Navigate2 "blogspot.com"
Case "Facebook"
WebBrowser1.Navigate2 "facebook.com"
Case "Google"
WebBrowser1.Navigate2 "google.com"
Case "IMDb"
WebBrowser1.Navigate2 "imdb.com"
Case "Imgur"
WebBrowser1.Navigate2 "imgur.com"
Case "Instagram"
WebBrowser1.Navigate2 "instagram.com"
Case "LinkedIN"
WebBrowser1.Navigate2 "linkedin.com"
Case "Microsoft"
WebBrowser1.Navigate2 "microsoft.com"
Case "MrExcel"
WebBrowser1.Navigate2 "mrexcel.com"
Case "MSN"
WebBrowser1.Navigate2 "msn.com"
Case "Netflix"
WebBrowser1.Navigate2 "netflix.com"
Case "PayPal"
WebBrowser1.Navigate2 "paypal.com"
Case "Reddit"
WebBrowser1.Navigate2 "reddit.com"
Case Else
MsgBox "I'm sorry, that is not yet available", vbInformation, "Ooops!"
End Select
End Sub
Same goes for another project I am up to as well:


Maybe somebody in here would have a way to somehow shorten the codes (I have a list of names where it contains like 50+, and I need to have it in like the directory, imagine the code :O )/ have other ways of doing what I have in mind.
Kind regards,
privxls