Help us understand the problem. What is going on with this article?

Excelで選択セル内容をGoogle検索するショートカット

More than 3 years have passed since last update.

'ショートカットに登録すると人によっては便利です。
'選択セル内容をgoogle検索する
Sub Google()
Dim myword As String
Dim myurl
myword = Selection(1).Value
'urlの時はそのまま表示
If Left(Trim(myword), 4) = "http" Then
myurl = Trim(myword)
'それ以外はGoogle検索
Else
myurl = "https://www.google.co.jp/search?q=" & UrlEncodeUtf8(myword)
End If
CreateObject("wscript.shell").Run myurl
End Sub

'URL文字列をUtf8でエンコードする関数
Function UrlEncodeUtf8(ByRef strSource As String) As String
Dim objSC As Object
Set objSC = CreateObject("ScriptControl")
objSC.Language = "Jscript"
UrlEncodeUtf8 = objSC.CodeObject.encodeURIComponent(strSource)
Set objSC = Nothing
End Function

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした