Excel Text-to-Columns using VB.net

前端 未结 1 628
有刺的猬
有刺的猬 2020-12-22 00:54

I have an excel sheet with variable number of entries in the column A. Sample:

402110000027547  97517161579      IDLE              402-11-150
40211000001326         


        
相关标签:
1条回答
  • 2020-12-22 01:21

    I got it working using this code:

    With sheet
            .Columns(1).TextToColumns( _
            Destination:=.Cells(1, 1), _
            DataType:=Excel.XlTextParsingType.xlDelimited, _
            TextQualifier:=Excel.XlTextQualifier.xlTextQualifierDoubleQuote, _
            ConsecutiveDelimiter:=False, _
            TAB:=False, _
            Semicolon:=False, _
            Comma:=False, _
            Space:=True, _
            Other:=False, _
            TrailingMinusNumbers:=False)
        End With
    

    Thanks to this page http://www.siddharthrout.com/index.php/2018/06/28/excel-text-to-columns-from-vb-net/

    0 讨论(0)
提交回复
热议问题