A列按” , “号分裂:
Sub test()
Columns("a:a").TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub
用逗号分列的vba代码如下:
sub 宏1()
selection.texttocolumns destination:=range("a1"), datatype:=xldelimited, _
textqualifier:=xldoublequote, consecutivedelimiter:=false, tab:=false, _
semicolon:=false, comma:=true, space:=false, other:=false, trailingminusnumbers:=true
end sub