|
楼主 |
发表于 2014-10-21 23:17
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Dim cnn As Object, SQL$
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=Microsoft.Ace.OLEDB.12.0;Extended Properties='text;hdr=no;FMT=FixedLength;CharacterSet=OEM';Data Source=" & ThisWorkbook.Path
SQL = "select trim(mid(mid(f1,224,16),instr(mid(f1,224,16),'_')+1,16)) ,right(f1,1) from demo.txt"
' SQL = "select * from demo.txt"
[b2].CopyFromRecordset cnn.Execute(SQL)
cnn.Close
Set cnn = Nothing
End Sub
这样可以了 |
|