- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-12-24 17:46 ½s¿è
¦^´_ 1# idsmchow
¦Û°Ê¿z¿ï- Option Explicit
- Sub Ex()
- Dim C As Integer
- C = 10
- With Sheets("Report")
- Do Until .Cells(C, "B") = ""
- If .Cells(C, "A") = "" Then
- .Range(.Cells(C, "E"), .Cells(C, "G")) = 0
- ElseIf .Cells(C, "A") = "Y" Then
- Sheets("Data").Cells.AutoFilter
- Sheets("Data").Cells.AutoFilter 1, "A"
- Sheets("Data").Cells.AutoFilter 2, .Cells(C, "B")
- .Cells(C, "E") = Application.Sum(Sheets("Data").Columns(3).SpecialCells(xlCellTypeVisible))
- Sheets("Data").Cells.AutoFilter
- Sheets("Data").Cells.AutoFilter 1, "B"
- Sheets("Data").Cells.AutoFilter 2, .Cells(C, "B")
- .Cells(C, "F") = Application.Sum(Sheets("Data").Columns(3).SpecialCells(xlCellTypeVisible))
- .Cells(C, "G") = .Cells(C, "E") + .Cells(C, "F")
- End If
- C = C + 1
- Loop
- End With
- Sheets("Data").AutoFilterMode = False
- End Sub
½Æ»s¥N½X |
|