拆分HTML标记中的字符串,并将它们放在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 4657 4732拆分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
我需要得到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内容示例。