ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

Do...While¦]¬°¦³ªÅ®æ´N¤£Ä~Äò¹B¦æªº°ÝÃD

Do...While¦]¬°¦³ªÅ®æ´N¤£Ä~Äò¹B¦æªº°ÝÃD

¨Ò¦p:a1="90¤À", a2="40¤À" a3="ªÅ®æ" a4"=60¤À"
¤U­±ªºvba¥u¹B¦æa1 ¦Üa2, a4¦]¬°a3¬OªÅ®æ, ©Ò¥H¨S¦³Ä~Äò¹B¦æ¡C
½Ð°Ý«ç¼Ë¥i¥H¹B¦æa1 ¦Üa4 ????

Sub b1()
Worksheets("Sheet1").Select
x = 1
Do While Cells(1, x) <> ""

Select Case Cells(1, x)
Case Is >= 90
Cells(2, x) = "A"
Case Is > 80
Cells(2, x) = "B"
Case Is >= 70
Cells(2, x) = "C"
Case Is >= 60
Cells(2, x) = "D"
Case Is >= 50
Cells(2, x) = "E"
Case Else
Cells(2, x) = "F"
End Select

x = x + 1
Loop

End Sub
HERO

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-3-24 08:27 ½s¿è

¦^´_ 1# Hero2013
  1. Option Explicit
  2. Sub b1()
  3.     Dim X As Integer, R As Integer
  4.     With Worksheets("Sheet1")
  5.         .Activate
  6.         R = .Cells(1, .Columns.Count).End(xlToLeft).Column
  7.         '¨ú±o¤u§@ªí³Ì¥kÄ橹¥ªª½¨ì²Ä¤@­Ó¦³¸ê®ÆªºÄæ¼Æ¸¹
  8.     End With
  9.     X = 1
  10.     Do While X <= R
  11.      'Do While X <= 15          '«ü©w½d³ò
  12.         Select Case Cells(1, X)
  13.             Case Is >= 90
  14.                 Cells(2, X) = "A"
  15.             Case Is >= 80
  16.                 Cells(2, X) = "B"
  17.             Case Is >= 70
  18.                 Cells(2, X) = "C"
  19.             Case Is >= 60
  20.                 Cells(2, X) = "D"
  21.             Case Is >= 50
  22.                 Cells(2, X) = "E"
  23.             Case Else
  24.                 Cells(2, X) = "F"
  25.         End Select
  26.         X = X + 1
  27.     Loop
  28. End Sub
  29. Sub Ex()
  30.     Dim E As Range
  31.     For Each E In Worksheets("Sheet1").[ A1:J1]
  32.         Select Case E
  33.             Case Is >= 90
  34.                 E.Cells(2) = "A"
  35.                 'E.Offset(1) = "A" '¤]¥i¥H¦p¦¹
  36.             Case Is >= 80
  37.                 E.Cells(2) = "B"
  38.             Case Is >= 70
  39.                 E.Cells(2) = "C"
  40.             Case Is >= 60
  41.                 E.Cells(2) = "D"
  42.             Case Is >= 50
  43.                 E.Cells(2) = "E"
  44.             Case Else
  45.                 E.Cells(2) = "F"
  46.         End Select
  47.     Next
  48. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

Á¤FGBKEEªO¥D
HERO

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD