|
我编写一段代码,在汇总表里汇总各SHEET里的数据,但最终都是数值 ,我想要带链接的,请帮助看一下怎么改,谢谢了。
Sub DL()
Dim arr1(), arr2()
For Each sh In Sheets
If sh.Name <> "DL" Then
With Sheets("DL")
.Cells(4 + N, 5) = sh.[F15]
.Cells(4 + N, 6) = sh.[H15]
.Cells(4 + N, 7) = sh.[J15]
.Cells(4 + N, 8) = sh.[L15]
.Cells(4 + N, 9) = sh.[N15]
.Cells(4 + N, 10) = sh.[P15]
.Cells(4 + N, 11) = sh.[R15]
.Cells(4 + N, 12) = sh.[T15]
.Cells(4 + N, 13) = sh.[V15]
End With
N = N + 1
sh.Name = sh.[D8]
End If
Next
End Sub
Sub DL()
Dim n
For Each sh In Sheets
If sh.Name <> "DL" Then
With Sheets("DL")
.Cells(4 + n, 5) = "=" & sh.Name & "!f15"
.Cells(4 + n, 6) = "=" & sh.Name & "!h15"
.Cells(4 + n, 7) = "=" & sh.Name & "!j15"
.Cells(4 + n, 8) = "=" & sh.Name & "!l15"
.Cells(4 + n, 9) = "=" & sh.Name & "!n15"
.Cells(4 + n, 10) = "=" & sh.Name & "!p15"
.Cells(4 + n, 11) = "=" & sh.Name & "!r15"
.Cells(4 + n, 12) = "=" & sh.Name & "!t15"
.Cells(4 + n, 13) = "=" & sh.Name & "!v15"
End With
n = n + 1
sh.Name = sh.[D8]
End If
Next
End Sub
|
|