Excel单元格中的数据输出到.txt
2013-01-09 00:07
253 查看
以第3列单元格中的数据为名称,建立.txt 文件,并写入第6列中的数据。从第2行循环至205行。
共创建204个.txt文件。代码如下:
Sub importData()
Dim sFile As Object
Dim FSO As Object
Dim iRow As Integer
Set FSO = CreateObject("Scripting.FileSystemObject")
'loop process:
For iRow = 2 To 205
Set sFile = FSO.CreateTextFile("Your path/" & Sheet1.Cells(iRow, 3).Value & ".txt", True)
sFile.writeline (Sheet1.Cells(iRow, 6).Value)
Next iRow
sFile.Close
Set sFile = Nothing
Set FSO = Nothing
End Sub
这里有更详细的讲解:http://www.excelpx.com/blog-11303-5308.html
共创建204个.txt文件。代码如下:
Sub importData()
Dim sFile As Object
Dim FSO As Object
Dim iRow As Integer
Set FSO = CreateObject("Scripting.FileSystemObject")
'loop process:
For iRow = 2 To 205
Set sFile = FSO.CreateTextFile("Your path/" & Sheet1.Cells(iRow, 3).Value & ".txt", True)
sFile.writeline (Sheet1.Cells(iRow, 6).Value)
Next iRow
sFile.Close
Set sFile = Nothing
Set FSO = Nothing
End Sub
这里有更详细的讲解:http://www.excelpx.com/blog-11303-5308.html
相关文章推荐
- ASP.NET中将数据输出到WORD、EXCEL、TXT、HTM
- .NET 将数据输出到WORD、EXCEL、TXT、HTM
- 把excel每一行中的数据输出为一个txt文档的VBA函数
- Html Table用JS导出excel格式问题 导出EXCEL后单元格里的000412341234会变成412341234 7-14 会变成 2018-7-14(7月14) 自定义格式 web利用table表格生成excel格式问题 js导出excel增加表头、mso-number-format定义数据格式 数字输出格式转换 mso-number-format:"\@"
- ASP.NET中将数据输出到WORD、EXCEL、TXT、HTM
- ASP.NET中将数据输出到WORD、EXCEL、TXT、HTM
- Python将二维列表(list)的数据输出(TXT,Excel)
- excel内一键进行sql查询(使用方法 1.选择’需要进行sql查询区域 包括字段名 2 输入sql语句 3.选择输出数据的单元格)
- ASP.NET中将数据输出到WORD、EXCEL、TXT、HTM
- ABAP利用OLE2_OBJECT实现将数据输出到Excel单元格
- ASP.NET中将数据输出到WORD、EXCEL、TXT、HTM
- 将在txt中的点数据批量arcgis插值后再输出为excel格式--未完
- ASP.NET中将数据输出到Excel,TXT, Word, Html
- java输出excel数据的方法示例(一种是到excel,一种是结构化数据到文本文件,可以用editplus之类的看)
- 无法读取Excel中的数据单元格。有数据,但是读出来全是空值
- excel文档插入新列报错:为了防止数据丢失,excel不能从表中移走非空单元格。
- python jieba分词并统计词频后输出结果到Excel和txt文档
- Asp.Net输出指定内容的Word、Excel、TXT、HTM等类型的文档
- 黄聪:phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- 如何设置excel单元格的数据类型