Sub kleinermuk_20201110()
'https://www.mrexcel.com/board/threads/new-macros-needed.115024
Dim co_name As String
lra = Range("a" & Rows.Count).End(3).Row
For company_count = 2 To lra
co_name = Sheets(1).Range("A" & company_count).Value
Sheets.Add after:=Sheets(Sheets.Count)
querry_add co_name
Sheets(1).Range("b" & company_count).Value = Sheets(Sheets.Count).Range("A21").Value
Sheets(1).Range("C" & company_count).Value = Sheets(Sheets.Count).Range("A22").Value
Sheets(Sheets.Count).Delete
Next company_count
End Sub
Sub querry_add(co_name As String)
search_link = "URL;https://www.google.hu/search?q=""" & co_name & """"
'bounch of the below with part is not necessary, but i let it there
With ActiveSheet.QueryTables.Add(Connection:=search_link, Destination:=Range("$A$1"))
.Name = "search?q=""magnotta winery""#spf=1604993071782"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub