Like this:
Sub addsSourceCode()
For x = 1 To 5
Worksheets("Combined").Select
Worksheets("Combined").Activate
mystr = "Url;view-source:jolly.house.gov/contact"
mystr = Cells(x, 3)
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "scode" & x
With ActiveSheet.QueryTables.Add(Connection:=mystr, Destination:=Range("$A$2"))
CommandType = 0
.Name = Cells(x, 1)
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
Next x
End Sub
I've run it, and if there was an actual www or url in place it would produce the page on each sheet, but all it gives me are 5 new blank sheets sc1 ... sc5
what I want is the Source Code in these sheets
Sub addsSourceCode()
For x = 1 To 5
Worksheets("Combined").Select
Worksheets("Combined").Activate
mystr = "Url;view-source:jolly.house.gov/contact"
mystr = Cells(x, 3)
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "scode" & x
With ActiveSheet.QueryTables.Add(Connection:=mystr, Destination:=Range("$A$2"))
CommandType = 0
.Name = Cells(x, 1)
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
Next x
End Sub
I've run it, and if there was an actual www or url in place it would produce the page on each sheet, but all it gives me are 5 new blank sheets sc1 ... sc5
what I want is the Source Code in these sheets