网页知识大全网站改版中:主站将改版成软件下载,PPT,个人简历等等内容,现有内容保留到旧版中去。
您所在的位置:首页 > 实例 > 正文

excel导出文件名与内容为txt

作者: 来源: 日期:2022/11/19 13:34:31 人气:96 加入收藏 标签:excel导出文件名与内容为txt

excel导出文件名与内容为txt的操作方法

Sub 按钮2_Click()

    arr = ActiveSheet.UsedRange

    For j = 2 To UBound(arr)

        If Len(arr(j, 1)) > 0 Then

            Open ThisWorkbook.Path & "\" & arr(j, 2) & ".txt" For Output As 1 'freefile

            Print #1, arr(j, 1)

            Close #1

        End If

    Next j

End Sub

本文网址:http://clewo.net/shili/291.html
读完这篇文章后,您心情如何?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0