TA的每日心情 | 开心 2014-1-11 00:20 |
---|
签到天数: 38 天 [LV.5]常住居民I
|
楼主 |
发表于 2014-3-12 12:39:08
|
显示全部楼层
老实说对于此类问题我现在学乖了不少,就是上网上搜索一下VBA,看看“export all sheets”,成筐的代码可以使用,比如:
代码:
Sub exportSheetsToText()
Dim sWb As String
Dim sFile As String
Dim oSheet As Worksheet
sWb = Left(ActiveWorkbook.FullName, InStr(ActiveWorkbook.FullName, ".") - 1)
For Each oSheet In Worksheets
oSheet.Copy
sFile = sWb & "-" & oSheet.Name & ".txt"
ActiveWorkbook.SaveAs Filename:=sFile, FileFormat:=xlText
ActiveWorkbook.Close SaveChanges:=False
Next oSheet
End Sub
|
|