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
读完这篇文章后,您心情如何?