如何在Excel中將Google搜索結果填充到工作表中?

      網友投稿 401 2025-03-31

      如何在Excel中將Google搜索結果填充到工作表中?

      在某些情況下,您可能需要在Google中進行一些重要的關鍵字搜索,并將最上面的搜索結果記錄保留在工作表中,該工作表包含文章的標題和超鏈接。 本文提供了一種VBA方法,可幫助您根據單元格中給定的關鍵字將Google搜索結果填充到工作表中。

      使用VBA代碼將Google搜索結果填充到工作表中

      使用VBA代碼將Google搜索結果填充到工作表中
      驚人的! 在 Excel 中使用高效的選項卡,如 Chrome、Firefox 和 Safari! 每天節省50%的時間,并減少數千次鼠標單擊!

      假設您需要搜索A列中列出的關鍵字,如下面的屏幕截圖所示,請按照以下步驟用VBA代碼將這些關鍵字的google搜索結果填充到相應的列中。

      1。 按 其他 + F11 鍵打開 Microsoft Visual Basic應用程序 窗口。

      2.在 Microsoft Visual Basic應用程序 窗口,請點擊 插頁 > 模塊。 然后將VBA代碼復制并粘貼到代碼窗口中。

      VBA代碼:將Google搜索結果填充到工作表中

      Sub xmlHttp() Updated by Extendoffice 2018/1/30 Dim xRg As Range Dim url As String Dim xRtnStr As String Dim I As Long, xLastRow As Long Dim xmlHttp As Object, xHtml As Object, xHtmlLink As Object On Error Resume Next Set xRg = Application.InputBox("Please select the keyWords you will search in Google:", "KuTools for Excel", Selection.Address, , , , , 8) If xRg Is Nothing Then Exit Sub Application.ScreenUpdating = False xLastRow = xRg.Rows.Count Set xRg = xRg(1) For I = 0 To xLastRow - 1 url = "https://www.google.co.in/search?q=" & xRg.Offset(I) & "&rnd=" & WorksheetFunction.RandBetween(1, 10000) Set xmlHttp = CreateObject("MSXML2.serverXMLHTTP") xmlHttp.Open "GET", url, False xmlHttp.setRequestHeader "Content-Type", "text/xml" xmlHttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0" xmlHttp.send Set xHtml = CreateObject("htmlfile") xHtml.body.innerHTML = xmlHttp.ResponseText Set xHtmlLink = xHtml.getelementbyid("rso").getelementsbytagname("H3")(0).getelementsbytagname("a")(0) xRtnStr = Replace(xHtmlLink.innerHTML, "<EM>", "") xRtnStr = Replace(xRtnStr, "</EM>", "") xRg.Offset(I, 1).Value = xRtnStr xRg.Offset(I, 2).Value = xHtmlLink.href Next Application.ScreenUpdating = True End Sub

      3. Press the F5 key to run the code. In the popping up Kutools for Excel dialog box, please select the cells containing keyWords you will search, and then click the OK button. See screenshot:

      Then all search results including titles and links are populated into corresponding column cells based on keywords. See screenshot:

      Related articles: How to populate a combo box with specified data on Workbook open? How to auto populate other cells when selecting values in Excel drop down list? How to auto populate other cells when selecting values in Excel drop down list?

      Best office Productivity Tools

      Transform Hours into Minutes with Kutools for Excel!

      Ready to supercharge your Excel tasks? Harness the power of Kutools for Excel - your ultimate time-saving tool. Streamline intricate tasks and glide through your data like a pro. Experience Excel at lightning speed!

      Why You Need Kutools for Excel

      ???  Over 300 Powerful Features: Kutools is packed with more than 300 advanced features, simplifying your work in over 1500 scenarios.

      ??  Superior Data Processing: Merge cells, remove duplicates, and perform advanced data conversions – all without breaking a sweat!

      ??  Efficient Batch Operations: Why put in extra effort when you can work smart? Import, export, combine, and tweak data in bulk with ease.

      ??  Customizable Charts and Reports: Access a broad variety of additional charts and generate insightful reports that tell a story.

      ???  Powerful Navigation Pane: Gain an advantage with the robust Column Manager, Worksheet Manager, and Custom Favorites.

      ??  Seven Types of Drop-down Lists: Make data entry a breeze with drop-down lists of various features and types.

      ??  User-Friendly: A breeze for beginners and a powerful tool for experts.

      如何在Excel中將Google搜索結果填充到工作表中?

      Download Now and Soar Through Time with Excel!

      Read More... Free Download... Purchase... 
      Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
      Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project. Open and create multiple documents in new tabs of the same window, rather than in new windows. Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
      Read More... Free Download... Purchase... 

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:Excel 財務崗小伙伴計算工作日必會的一個函數
      下一篇:Oracle數據庫的體系結構
      相關文章
      亚洲一区二区三区高清视频| 日本系列1页亚洲系列| 日韩精品亚洲aⅴ在线影院| 日本亚洲免费无线码| 亚洲AV无码乱码在线观看代蜜桃| 亚洲电影中文字幕| 亚洲AV日韩AV永久无码久久| 亚洲av无码片在线播放| 亚洲av无码一区二区三区不卡| 亚洲va国产va天堂va久久| 亚洲AV无码一区二区二三区入口| 亚洲AV无码成人精品区天堂| 亚洲乱码一区二区三区在线观看 | 亚洲一本一道一区二区三区| 日韩亚洲人成在线| 亚洲欧洲国产综合AV无码久久| 亚洲中文字幕精品久久| 亚洲gay片在线gv网站| 久久精品国产亚洲AV| 午夜亚洲国产成人不卡在线| 亚洲不卡无码av中文字幕| AV在线播放日韩亚洲欧| 亚洲中文字幕无码一区二区三区 | 亚洲AV无码精品无码麻豆| 无码乱人伦一区二区亚洲| 亚洲网站视频在线观看| 亚洲人成影院77777| 亚洲色一区二区三区四区| 亚洲av日韩专区在线观看| 亚洲国产精品一区二区三区久久| 久久久久国产成人精品亚洲午夜| 亚洲日韩国产精品第一页一区| 久久亚洲伊人中字综合精品| 亚洲综合亚洲国产尤物| 亚洲黄色激情视频| 欧洲亚洲国产精华液| 亚洲综合最新无码专区| 亚洲国产AV无码专区亚洲AV| 67pao强力打造67194在线午夜亚洲| 亚洲fuli在线观看| 日韩亚洲翔田千里在线|