- ©«¤l
- 234
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 276
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-1-7
- ³Ì«áµn¿ý
- 2021-10-7
|
¥»©«³Ì«á¥Ñ jcchiang ©ó 2020-7-29 10:51 ½s¿è
¦^´_ 4# edmondsforum
ã¤j¤w¸gÂI¥X«Ü¦h¥i¯àªº°ÝÃD,¥ý¥HÀɮתº¸ê®Æ°µµ{¦¡½Õ¾ã,¨ä¾l³¡¥÷½Ð¦Û¦æקï
Sub ex1()
Dim arr, a, c, B%, QQ%, R%
Dim sht As Object
Dim d As Object
Set d = CreateObject("Scripting.Dictionary")
Sheets("³æ»ù¤ÀªRÁ`ªí").Cells.Clear
arr = Array("¤@", "¤G", "¤T", "¥|", "¤") '¤uµ{¶µ¦¸
For Each sht In Worksheets
If sht.Name Like "*³æ»ù¤ÀªR" Then
With Sheets(sht.Name)
For Each a In .Range(.[b2], .[b65535].End(3))
For x = 0 To UBound(arr)
If a.Value = arr(x) And Not d.Exists(a.Value) Then d.Add a.Value, sht.Name & "@" & a.Address
Next
Next
End With
End If
Next
R = 6
For Each a In arr
For B = 0 To d.Count - 1
If a = d.keys()(B) Then
c = Split(d.items()(B), "@")
With Sheets(c(0))
For QQ = 1 To 100
If .Range(c(1)).Offset(QQ, 1) = "¤p p" Then Exit For
Next
.Range(c(1)).Resize(QQ + 2, 8).Copy Sheets("³æ»ù¤ÀªRÁ`ªí").Cells(R, 2)
R = R + QQ + 3
End With
End If
Next
Next
With Sheets("³æ»ù¤ÀªRÁ`ªí")
.Cells.Font.Name = "µØ±dÁõ®ÑÅéW5"
.Cells.Font.ColorIndex = 1
.[b5].Value = "¶µ¦¸"
.[b5].HorizontalAlignment = xlCenter
With .Range("B2:H2")
.Merge
.Value = "·PÁ³»¶®a±Ú°Q½×ª©"
.HorizontalAlignment = xlCenter
.Font.Bold = True
.Font.Size = 16
End With
With .Range("B3:H3")
.Merge
.Value = "³æ»ù¤ÀªRªí"
.HorizontalAlignment = xlCenter
.Font.Underline = xlUnderlineStyleSingle
.Font.Size = 14
End With
.Range("c4:H4").Merge
.[c4].Value = "¤uµ{¦WºÙ¡G³Â»¶®a±Ú°Q½×ª©"
.Range("c5:H5").Merge
.[c5].Value = "¤uµ{½s¸¹¡GExcelvba"
.Range(.[b6], .Cells(.[c65535].End(3).Row, 8)) = .Range(.[b6], .Cells(.[c65535].End(3).Row, 8)).Value
End With
Set d = Nothing
End Sub |
|