Hello, I am currently using the following code to pull in data from various websites.
Sub Macro3()
'
' Macro3 Macro
'
'
Dim Erw, Frw, Lrw
Frw = 1
Lrw = Range("A" & Rows.Count).End(xlUp).Row
For Erw = Frw To Lrw
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & Range("A" & Erw).Value, Destination:=Range("B" & Erw))
.Name = ""
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = x1InsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "10"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next Erw
End Sub
I have all web address' on column A, and the code looks at each link then pulls the 20 rows of data I need from the websites.
ex.
Stock Screener - Custom
Stock Screener - Custom
The problem I have is that the code will paste into cell B1, then paste into cell B2 etc. Considering the data I am importing is 20 rows long, I need the code to paste to every 20 rows in column B.
I can't figure out how to do that.
Thanks for anyone that can help.
Sub Macro3()
'
' Macro3 Macro
'
'
Dim Erw, Frw, Lrw
Frw = 1
Lrw = Range("A" & Rows.Count).End(xlUp).Row
For Erw = Frw To Lrw
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & Range("A" & Erw).Value, Destination:=Range("B" & Erw))
.Name = ""
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = x1InsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "10"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next Erw
End Sub
I have all web address' on column A, and the code looks at each link then pulls the 20 rows of data I need from the websites.
ex.
Stock Screener - Custom
Stock Screener - Custom
The problem I have is that the code will paste into cell B1, then paste into cell B2 etc. Considering the data I am importing is 20 rows long, I need the code to paste to every 20 rows in column B.
I can't figure out how to do that.
Thanks for anyone that can help.