Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
拆分HTML标记中的字符串,并将它们放在VBA的不同列中_Vba - Fatal编程技术网

拆分HTML标记中的字符串,并将它们放在VBA的不同列中

拆分HTML标记中的字符串,并将它们放在VBA的不同列中,vba,Vba,我有以下html格式的数据 .... 35.25 65.45 Car 0.2584 0.2587 0.2413 0.8956 8456 4512 556 45.23 IN 1.3696 4.2384 9.2475 4657 4732 .... 35.25 65.45轿车0.2584 0.2587 0.2413 0.8956 8456 4512 556 45.23英寸1.3696 4.2384 9.2475 465

我有以下html格式的数据

.... 35.25 65.45 Car 0.2584 0.2587 0.2413 0.8956 8456 4512 556 45.23 IN 1.3696 4.2384 9.2475 4657 4732 .... 35.25 65.45轿车0.2584 0.2587 0.2413 0.8956 8456 4512 556 45.23英寸1.3696 4.2384 9.2475 4657 4732
我需要得到8列和同一行中的值

我认为宏记录器在这里会非常有用

Sub Macro1()

    Columns("A:A").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
        Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
        Array(7, 1), Array(8, 1)), TrailingMinusNumbers:=True
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Cells.Select
    Cells.EntireColumn.AutoFit
    Range("A1").Select
End Sub

请告诉我们你先做了什么。我试过使用正则表达式。但我想看看我们是否可以使用字符串和数组操作,这将使uderstands变得容易。请编辑问题并添加HTML内容示例。