How to modify my VBS search tool to be site(s) specific?

rhelm

New Member
Joined
Mar 20, 2019
Messages
17
Greetings,

I have found the below google search tool to be a big help. It simply runs a google search on whatever cells that I've highlighted with a single button press.

I'd like to modify to only return specific sites in the results via these two additions: site:Bloomberg.com AND site:manta.com

However, I'm not sure how to fold it into the argument. Could somebody point me in the right direction?

Sub GoSearch()
Dim rng As Range
Dim strURL As String
Dim strCriteria As String
Dim strArgument As String


strURL = "http://www.google.com/search?q="
strArgument = "&lc=www&btnG=Google+Search"


For Each rng In Selection
If Len(rng) > 0 Then
strCriteria = strCriteria & " " & rng
End If
Next


strCriteria = Mid(strCriteria, 2)


ActiveWorkbook.FollowHyperlink ADDRESS:=strURL _
& strCriteria & strArgument


End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,223,692
Messages
6,173,864
Members
452,535
Latest member
berdex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top