VBA怎么把某个Sheet所有单元格的内容Print到文本
DimFilenameAsString,iAsInteger,xAsIntegerFilename=Application.ActiveWorkbook.Path&"\T...
Dim Filename As String, i As Integer, x As Integer
Filename = Application.ActiveWorkbook.Path & "\Test.TXT"
Open Filename For Append As #1
Print #1, xxxx
Close
XXXX这里要怎么写,不要用SaveAs方法 展开
Filename = Application.ActiveWorkbook.Path & "\Test.TXT"
Open Filename For Append As #1
Print #1, xxxx
Close
XXXX这里要怎么写,不要用SaveAs方法 展开
2个回答
展开全部
Sub PRINTSheet1()
Dim Filename As String, x As Integer, y As Integer, Arr
Arr = Sheet1.UsedRange
Filename = Application.ActiveWorkbook.Path & "\Test.TXT"
Open Filename For Append As #1
For x = 1 To UBound(Arr, 1)
For y = 1 To UBound(Arr, 2)
Print #1, Arr(x, y);
咐郑链 Next
丛铅 Print #1,
衡孙 Next
Close
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用workbook的saveas 方法吧。
粗迟燃
Dim Filename As String, i As Integer, x As Integer
Filename = Application.ActiveWorkbook.Path & "\Test.TXT"旦罩
ThisWorkbook.SaveAs Filename:=Filename, 岩虚FileFormat:=xlText, CreateBackup:=False
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询