帖子状态: 【普通】  切换本版文章:9 7 8 :
 主题:将若干部门预算表放置一个文件夹然后汇总
点击:396 回复:1 楼主  
 昵称:清霜残雪
 
 头衔:版主
 积分:303分
 注册:2009-7-15
 状态:离线
查看清霜残雪的个人资料 给清霜残雪发个短消息 给清霜残雪发个email  访问清霜残雪的个人主页 搜索论坛 查看清霜残雪的所有帖子  论坛帮助 打印本页 点此放大字体 点此变为中号字体 点此缩小字体        

预算取数各部门
Private Sub File1_Click()

File1.Path = "D:\青云富\9-预算执行情况\2010影城预算\2-2010年目标预算\2010年新街口店预算\新街口各部门预算数据"
File1.Pattern = "*.xls"

Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlb As Excel.Workbook
Dim xlsheet As Excel.Worksheet

Set xlapp = New Excel.Application
xlapp.Visible = True
Set xlbook = xlapp.Workbooks.Open("D:\青云富\9-预算执行情况\2010影城预算\2-2010年目标预算\2010年新街口店预算\23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909")
Dim i, x, ii As Integer
For i = 0 To File1.ListCount
Set xlb = xlapp.Workbooks.Open("D:\青云富\9-预算执行情况\2010影城预算\2-2010年目标预算\2010年新街口店预算\新街口各部门预算数据\" & File1.List(i))
If InStr(File1.List(i), "营销部") Then
ii = 2
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 4
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 5
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
End If
If InStr(File1.List(i), "营运部") Then
ii = 3
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 6
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
End If
If InStr(File1.List(i), "放映部") Then
ii = 7
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
End If
If InStr(File1.List(i), "财务部") Then
ii = 8
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Select
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 9
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 10
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
End If
If InStr(File1.List(i), "行政部") Then
ii = 11
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
Windows(File1.List(i)).Activate
ii = 12
xlb.Worksheets(ii).Select
xlb.Worksheets(ii).Unprotect Password:="wandacaiwu"
Cells.Select
Selection.Copy
Windows("23-万达影城预算编制(底稿)-2010财年-南京万达影城-200909.xls").Activate
xlbook.Worksheets(ii).Unprotect Password:="wandacaiwu"
xlbook.Worksheets(ii).Select
Range("a1").Select
ActiveSheet.Paste
End If

xlb.Close (True)
100: Next i
xlbook.Close (True)
End Sub


明强、敬恕,如履薄冰。
自信、努力、实现理想。
发表:2009/10/3 12:31:51
 主题:我的回复如下!
1楼  
 昵称:江城子
 
 头衔:版主
 积分:305分
 注册:2002-12-18
 状态:离线
查看江城子的个人资料 给江城子发个短消息 给江城子发个email  访问江城子的个人主页 搜索论坛 查看江城子的所有帖子  论坛帮助 打印本页 点此放大字体 点此变为中号字体 点此缩小字体      

很好,区域影城可以效仿!
建议用设计几个简单的表,做一个范例,上传上来更好!

格物致知!!
发表:2009/10/12 9:21:53
切换本版文章:9 7 8 :
 快速回复:将若干部门预算表放置一个文件夹然后汇总
   
 呢 称:  密 码: 接头码: 验证码: 验证码 点此注册 忘记密码  
 主 题:  点此添加简单表情表情符号
 内 容:
  • HTML禁止
  • UBB可用
  • 表情图标提示
  • 想要上传、使用UBB提示请点击[回复帖子]
  • 正文不能少于10个字
 

前沿论坛 Ver2.5, Copyright (C), Powered By Leon Li