提取excel中的数据, 并生成bat批量处理
展开全部
建立个按钮,把代码复制进去就成了~
这是把F和M列的内容写到"f:\批量.bat",每次执行都会把原本内容覆盖的,想保留原数据就改成“Open "f:\批量.bat" For Append As #1”
Private Sub CommandButton1_Click()
Dim a
Open "f:\批量.bat" For Output As #1
For a = 1 To WorksheetFunction.CountA(Columns(6))
Print #1, Range("f" & a)
Next
For a = 1 To WorksheetFunction.CountA(Columns(13))
Print #1, Range("m" & a)
Next
Close #1
End Sub
这是把F和M列的内容写到"f:\批量.bat",每次执行都会把原本内容覆盖的,想保留原数据就改成“Open "f:\批量.bat" For Append As #1”
Private Sub CommandButton1_Click()
Dim a
Open "f:\批量.bat" For Output As #1
For a = 1 To WorksheetFunction.CountA(Columns(6))
Print #1, Range("f" & a)
Next
For a = 1 To WorksheetFunction.CountA(Columns(13))
Print #1, Range("m" & a)
Next
Close #1
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |