excel按固定行数拆分成多个txt ,VBA代码怎么写
展开全部
请你试试:
Sub 宏1()
lastrow = Cells(Rows.Count, 1).End(3).Row
mypath = "d:\T\"
m = 1
y = 1
Do Until m > lastrow
For n = m To m + 4499
Open mypath & Format(y, "P000") & ".txt" For Append As #1
Print #1, Cells(n, 1).Value
Close #1
Next n
m = m + 4500
y = y + 1
Loop
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询