- ©«¤l
- 559
- ¥DÃD
- 58
- ºëµØ
- 0
- ¿n¤À
- 626
- ÂI¦W
- 0
- §@·~¨t²Î
- win8
- ³nÅ骩¥»
- office2013
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2010-11-22
- ³Ì«áµn¿ý
- 2024-6-14
|
¥»©«³Ì«á¥Ñ hugh0620 ©ó 2011-4-25 11:20 ½s¿è
¦^´_ 1# monstrooilis
¼Ó¥D~ ¤U¸ü±zªºªþ¥ó~ ¤Ö¤@ÓÄæ¦ìby month~ ¬O§_¥i¥H¸É»ô~
³o¼Ë¤ñ¸û¦n³B²z~ ±z©Ò»Ýnªºµ²ªG~
Y¤£ª¾¹D½X«ç»ò¼g~ ¥i¥H¨Ï¥Î[¿ý»s¥¨¶°]ªº¤è¦¡~ ¸Õ¤@¤U~
¤Uzµ{¦¡½X»P¼Ó¥D²{¦b¨Ï¥Îªº¤è¦¡,¥i¥H¹F¨ì¬Û¦Pªº¥\¯à~
Sub CalcGrades()
StudentID = Val(InputBox("Enter the student ID"))
If StudentID = False Then Exit Sub '¦h¤@¦æ~ ¥i¥H¨Ï±z¦b¥¼¿é¤JȪº®ÉÔ,¤£·|²£¥Í°õ¦æ¤Wªº¿ù»~
Range("G1").Value = StudentID
Range("G2").Value = Application.WorksheetFunction.VLookup(StudentID, Range("A2:B" & intLastRow), 2, False)
lCount = Application.CountIf(Range("B:B"), Range("G2"))
Mark = Application.SumIf(Range("B:B"), Range("G2"), Range("C:C"))
Mark = Round(Mark / lCount, 2)
Range("G3").Value = Mark
End Sub |
|