虫虫技术在线--技术决定出路

当前位置: 首页 > 办公 > Excel >

VBA 写入文本文件

时间:2010-03-18 22:55来源:虫虫技术在线收集整理 作者:虫虫编辑 点击:
代码如下: Function WriteFile() Dim fs,a As Object Set fs=CreateObject( Scripting.FileSystemObject ) Set a=fs.createtextfile(ThisWorkbook.Path \ Get_Pictures.html, True ) For RowNo=1 To RowsCount strC= C RowNo a.write(Range(strC)) Next

代码如下:

 

  1. Function WriteFile()  
  2.  
  3. Dim fs, a As Object 
  4. Set fs = CreateObject("Scripting.FileSystemObject")  
  5. Set a = fs.createtextfile(ThisWorkbook.Path & "\" & "Get_Pictures.html", True)  
  6. For RowNo = 1 To RowsCount  
  7. strC = "C" & RowNo  
  8. a.write (Range(strC))  
  9. Next 
  10. a.Close  
  11.  
  12. End Function 

 

(责任编辑:admin)
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容