は私がURLに変数を埋め込むためのコードを編集し、マクロを記録し、管理することにより、
Sub web_query()
' web_query Macro
' This macro generates the web query used to populate sheet'
'get the file ID
FILE_ID = Sheets("intake").Range("B1")
If FILE_ID <> "" Then
With Sheets("web_query").QueryTables.Add(Connection:="URL;http://url part1"
_& FILE_ID & "url part2", Destination:=Sheets("web_query").Range("$A$1"))
.Name = "query=short_descriptionLIKE" & FILE_ID & "&row_count=999999999"
.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 If
End Sub