私はExcel VBAの初心者です。問題は次のとおりです。識別子を指定して、Web ページから一部のテキストを削除したいと考えています。理想的には、ページのテキストを単一のセルに保存したいと考えています。QueryTable を作成する関数を作成しましたが、取得したテキストが複数の行にコピーされることがあります。
すべてのテキストを単一のセルに配置する方法はありますか?
私の関数のコードは次のとおりです。
Function Articolo(myRange As Range, code As String)
Dim myURL As String
Dim myName As String
myURL = "URL;http://techstore.runner.it/feed/dettagli_csv.php?codcli=111367&pwd=03142110786&sku=" & code
myName = "dettagli_csv.php?codcli=111367&pwd=03142110786&sku=" & code
With ActiveSheet.QueryTables.Add(Connection:= _
myURL _
, Destination:=myRange)
.Name = myName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = False
.WebSingleBlockTextImport = True
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.WebConsecutiveDelimitersAsOne = True
.Refresh BackgroundQuery:=False
End With
End Function
テストとして、コードとして 8E4374 を使用できます
ご協力いただきありがとうございます!