- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 255
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-24
|
¦^´_ 22# candy516
¥i¯à¦³2ºØ±¡ªp§a- Sub ex()
- Dim A As Range, B As Range, B1 As Range, B2 As Range, C As Range, Rng As Range, Rng1 As Range, d As Object
- Set d = CreateObject("Scripting.Dictionary")
- Set sht = Sheets.Add(after:=Sheets(1))
- Application.ScreenUpdating = False
- With Sheet1
- For Each A In .Range(.[A2], .[A65536].End(xlUp))
- mystr = A & "," & A.Offset(, 1)
- d(mystr) = DateValue(Format(A.Offset(, 1), "0000/00/00"))
- 'Y¬Oª½±µ¥Î¨Æ¥ó«á²Ä4¤Ñ°µ·j´MÈ
- 'd(mystr) = DateValue(Format(A.Offset(, 1), "0000/00/00")) + 4
- Next
- End With
- k = 1: r = 1
- For Each ky In d.keys
- y = Left(Split(ky, ",")(1), 4)
- With Sheets(y)
- Set C = .Columns("A").Find(d(ky))
- Set B = .Rows(1).Find(Split(ky, ",")(0))
- If Not C Is Nothing And Not B Is Nothing Then
- x = Application.Max(3, C.Row - 5)
- '¥Î¨Æ¥ó¤é¦V¤W4®æ¬°¥Ø¼Ð
- Set Rng = .Cells(x, 1)
- Set Rng1 = .Cells(x, B.Column)
- 'ª½±µ¥Î¨Æ¥ó«á²Ä4¤Ñ°µ·j´MÈ
- 'Set Rng = .Cells(C.Row, 1)
- 'Set Rng1 = .Cells(C.Row, B.Column)
- With sht
- Rng.Copy .Cells(r, k)
- Rng1.Copy .Cells(r, k + 1)
- .Cells(r, 3) = y & "¦~²Ä" & B.Column - 1 & "µ§"
- End With
- r = r + 1 '¥u¦³¤@¤Ñ¸ê®Æ©Ò¥H¥un¥[1
- Else
- MsgBox "µL" & y & "¦~" & Split(ky, ",")(0) & "¨Æ¥ó¸ê®Æ"
- End If
- End With
- Next
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|