|
貌似这个要用到VBA来完成吧!
我这有一段和你这类似的,看你有用不?
'生成临时工作表
FilePath = ActiveWorkbook.Path
FileName = Dir(FilePath & "\" & "*.xls")
AWBName = ActiveWorkbook.Name
Workbooks.Add.SaveAs FileName:="c:\windows\temp\提取工资表.xls"
Do While FileName <> "" And FileName <> "temp"
If FileName <> AWBName Then
Set WB = Workbooks.Open(FilePath & "\" & FileName)
Num = Num + 1
'将每个工作薄的“工资核算”表打开,工作表移动复制到临时工作表"提取工作表"第一个表的后面
With Sh
Sheets("工资核算").Visible = xlSheetVisible
Sheets("工资核算").Select
Sheets("工资核算").Copy after:=Workbooks("提取工资表.xls").Sheets(1)
Cells.Select
'并复制,选择性数值粘贴一次
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
OWBN = OWBN & Chr(13) & WB.Name
End With
ActiveSheet.Name = Cells(3, 1)
ActiveSheet.Cells(1, 1).Select
WB.Close False
End If
FileName = Dir
Loop
如果你要做,发文件,研究一下! |
|