On sheet1 in Excel 2007 I have a list starting in cell A1=cat, B1=dog, C1=mouse.
I recorded a macro that does a web query for data at Yahoo and for search term "cat".
How can I repeat the macro for the whole list A1, B1, C1?
Thanks,
I recorded a macro that does a web query for data at Yahoo and for search term "cat".
How can I repeat the macro for the whole list A1, B1, C1?
Code:
Sub YahooSearch()
'
' YahooSearch Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://search.yahoo.com/search;_ylt=A2KK_foKYzdS7TQAH36bvZx4?p=cat&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-900" _
, Destination:=Range("Sheet2!$A$1"))
.Name = _
"search;_ylt=A2KK_foKYzdS7TQAH36bvZx4?p=cat&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-900"
.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
Sheets("Sheet2").Select
ActiveWindow.SmallScroll Down:=159
End Sub
Thanks,