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

[µo°Ý] ¦p¦ó¿ï¾Ü¤¶©ó¤@­Ó½d³òªº°ÝÃD

[µo°Ý] ¦p¦ó¿ï¾Ü¤¶©ó¤@­Ó½d³òªº°ÝÃD

¤p§Ì¦³­Ó°ÝÃD

§Ú¦³¤@¦C¸ê®Æ¦p¤U¡A
       A¦C  
1     10
2     11
3     12
4     13
5     14
6     13
7     12
8     11
9     10
10  10
11  10
12  11
13  12
14  13
15  14

§Úªº°ÝÃD¬O¡A°²¦p³o¦C¸ê®Æ¼Æ³sÄò"¤j©ó3µ§¸ê®Æ"³£¤¶©ó(10~11)¤§¶¡¡A

§P©w¥L¬°¿ù»~¡A­×§ï¬°ªÅ­È¡C(¦p¡G²Ä8µ§¸ê®Æ¨ì²Ä12µ§³£¦b10~11¤§¶¡¡A©Ò¥H­È³£¬°0¡C)

¦pªG¥¼¶W¹L3µ§«hÄ~Äò¡C

½Ð°Ý¦U¦ì¤j®v³o¼Ë»yªk¦p¦ó¤U?

¦^´_ 1# 518587
  1. Option Explicit
  2. Sub Ex()
  3.     Dim AR, i As Integer, ii As Integer, X As Integer
  4.     AR = Application.WorksheetFunction.Transpose([A1:A15])
  5.     For i = 1 To UBound(AR)
  6.         If AR(i) >= 10 And AR(i) <= 11 Then
  7.             X = X + 1
  8.         Else
  9.             If X >= 3 Then
  10.                 For ii = X To 1 Step -1
  11.                     AR(i - ii) = 0
  12.                 Next
  13.             End If
  14.             X = 0
  15.         End If
  16.     Next
  17.     [b1:b15] = Application.WorksheetFunction.Transpose(AR)
  18.     'Åã¥Ü¦bBÄæ
  19. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


·PÁ¤j®v´£ÂI¡A¦ý§ÚÁÙ¦³­Ó¤pºÃ°Ý  AR = Application.WorksheetFunction.Transpose([A1:A15])

³o¸Ì[A1:A15]§Ú±N¥¦§ï¬°[A:A]¤@¾ã¦C¡A¤£¹L«o¤£¯à(·Q§ï¦¨³o¼Ë­ì¦]¬O¸ê®Æ¼Æ¤£¤@©w©T©w!)

½Ð°Ý³o³¡¤À°ÝÃD¥X¦b­þ¸Ì? ¯à§_½Ð¤j®v´£ÂI! ·PÁÂ

TOP

¦^´_ 3# 518587
  1. Sub ex()
  2. r = 2: k = 0
  3. Do Until Cells(r, 2) = ""  'BÄ欰ªÅ¥Õ®É°h¥X°j°é
  4. Do Until Cells(r, 2) < 10 Or Cells(r, 2) > 11  '<10©Î>11(¤£¤¶©ó10~11¤§¶¡)°h¥X°j°é
  5.    k = k + 1  '­p¼Æ
  6.    r = r + 1
  7. Loop
  8. If k > 3 Then
  9.    Cells(r, 2).Offset(-k).Resize(k, 1) = 0  '±N¤º®e§ï¬°0
  10. End If
  11. r = r + 1: k = 0  '¦C¦ì¥[1¡A­p¼ÆÂk¹s
  12. Loop
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD