分类汇总
求多工作表分类汇总的VBA代码!!
Sub hz1() Dim i&, Myr&, x$, Arr Dim d, k, t Set d = CreateObject("Scripting。Dictionary") Application。
ScreenUpdating = False Sheet2。Activate [a6:c200]。ClearContents Myr = Sheet1。[ak65536]。End(xlUp)。Row Arr = Sheet1。
Range("ak2:ap" & Myr) For i = 1 To UBound(Arr) If Arr(i, 4) <> "" Then x = Arr(i, 4) & "," & Arr(i, 5) d(x) = d(x) + Arr(i, 6) End If Next k = ys t = ems [a6]。
Resize(d。Count) = Application。Transpose(k) [c6]。Resize(d。Count) = Application。Transpose(t) Application。DisplayAlerts = False [a6]。
Resize(d。Count)。TextToColumns Destination:=[a6], Comma:=True Application。DisplayAlerts = True Application。ScreenUpdating = True End Sub Sub hz2() Dim i&, Myr&, x$, Arr Dim d, k, t Set d = CreateObject("Scripting。
Dictionary") Application。ScreenUpdating = False Sheet3。Activate [a6:c200]。ClearContents Myr = Sheet1。
[ak65536]。End(xlUp)。Row Arr = Sheet1。Range("ak2:ap" & Myr) For i = 1 To UBound(Arr) If Arr(i, 3) <> "" Then x = Arr(i, 3) & "," & Arr(i, 4) & "," & Arr(i, 5) d(x) = d(x) + Arr(i, 6) End If Next k = ys t = ems [a6]。
Resize(d。Count) = Application。Transpose(k) [d6]。Resize(d。Count) = Application。Transpose(t) Application。DisplayAlerts = False [a6]。
Resize(d。Count)。TextToColumns Destination:=[a6], Comma:=True Application。DisplayAlerts = True Application。ScreenUpdating = True End Sub。
答:你是指在EXCEL里面吧,排序只为了便于按照类别进行汇总,如果不排序,EXCEL不会自动将相同的类别归在一起后汇总,分类汇总应该是两个步骤,呵呵,电脑也只会一步...详情>>
答:Rapid development in the Internet today, many people in the use of new network t...详情>>
答:Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFile...详情>>