- ©«¤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-25
|
¦^´_ 7# pcwh3 - Sub WHREPORT()
- Dim Rng As Range, A As Range, i%, k%
- With ActiveSheet
- st = .[A6]
- d = Day(DateAdd("M", 1, st) - 1)
- Set Rng = .Range("A6", .[A65536].End(xlUp)).SpecialCells(xlCellTypeBlanks)
- Rng.Areas(2)(1).Offset(, 1).Resize(2, 16) = ""
- Rng.Areas(1)(1).Offset(, 1).Resize(, 15).FormulaArray = "=COLUMN(A1:O1)"
- Rng.Areas(1)(1).Offset(1, 1).Resize(, 15).FormulaR1C1 = "=UPPER(TEXT(TEXT(R6C1,""yyyy/mm/"")&R[-1]C,""ddd""))"
- Rng.Areas(1)(1).Offset(, 1).Resize(2, 15) = Rng.Areas(1)(1).Offset(, 1).Resize(2, 15).Value
- Rng.Areas(2)(1).Offset(1, 1).Resize(, d - 15).FormulaR1C1 = "=UPPER(TEXT(TEXT(R6C1,""yyyy/mm/"")&R[-1]C,""ddd""))"
- Rng.Areas(2)(1).Offset(, 1).Resize(, d - 15).FormulaArray = "=TRANSPOSE(ROW(A16:A" & d & "))"
- Rng.Areas(2)(1).Offset(, 1).Resize(2, d - 15) = Rng.Areas(2)(1).Offset(, 1).Resize(2, d - 15).Value
- k = Rng.Areas(2).Row - Rng.Areas(1).Row
- For i = 1 To 2
- For Each A In Rng.Areas(i)(1).Offset(1, 1).Resize(, 15)
- If A = "MON" Then
- A.Offset(-1, 0).Resize(k, 1).Interior.ColorIndex = 6
- Else
- A.Offset(-1, 0).Resize(k, 1).Interior.ColorIndex = -4142
- End If
- Next
- Next
- End With
- End Sub
½Æ»s¥N½X |
|