是不是把每个excel文件中的A1,V1,W1依次拷到新表中放在A,B,C列中,
用的excel2003,打开新工作簿,
1.工具-宏-安全性-中
2.工具-宏-Visualbasic编辑器-双击thisworkbook,在中间空白处粘贴以下代码;
3.点击工具栏中三角形运行(或按键盘F5)
Sub Macro1()
xlsname = ActiveWorkbook.Name
Wndname = ActiveSheet.Name
dirname = "c:\gupiao\" '不能少最后那个\
fln = Dir(dirname)
j = 1 '新表中粘贴起始行号
Application.ScreenUpdating = False
Do While fln <> ""
Workbooks.Open Filename:=dirname & fln
Set data = Application.Union(Range("A1"), Range("V1"), Range("W1"))
data.Copy
Workbooks(xlsname).Sheets(Wndname).Activate
Cells(j, 1).Select
ActiveSheet.Paste
j = j + 1
Application.CutCopyMode = False
Workbooks(fln).Close SaveChanges:=False
fln = Dir
Loop
Application.ScreenUpdating = True
End Sub