|
本帖最后由 zqxzhs 于 2012-1-29 21:31 编辑
Sub 数组嵌套() ' 参考答an(1)
'引用Microsoft Scripting Runtime
Dim ary(), temp, arr, brr(), k, sh As Worksheet
Dim d As New Dictionary, ds As New Dictionary, dic As New Dictionary, dm As New Dictionary, dn As New Dictionary
Dim myPath$, myFile$, i&, j&, lc&, shc&, shn$
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each sh In Sheets
If sh.Name <> ActiveSheet.Name Then sh.Delete '删除可能存在的已汇总工作表
Next
Application.DisplayAlerts = True
myPath = ThisWorkbook.Path & "\数据源\"
myFile = Dir(myPath & "*.xls")
Do While myFile <> ""
Set wb = GetObject(myPath & myFile) '打开个工作簿
For Each sh In wb.Sheets '逐表
With sh
shn = .Name '表名
If Not d.Exists(shn) Then
请问:“数据源”文件夹能否用工作表“总”的a1单元格的值来表示呢?如果能的话,应如何写代码? |
|