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

[µo°Ý] §PÂ_­È³W®æ½d³ò,¨Ã¥[´î©T©w­È«á,¦A¨ú¥N¸ÓÀx¦s®æ­ì­È

[µo°Ý] §PÂ_­È³W®æ½d³ò,¨Ã¥[´î©T©w­È«á,¦A¨ú¥N¸ÓÀx¦s®æ­ì­È

¥»©«³Ì«á¥Ñ kasa ©ó 2015-4-16 00:55 ½s¿è

½Ð±Ð¦U¦ì±M®a
¦p¦ó±NAÄ椧©Ò¦³¦³¶ñ¤J¼Æ¦r¤§Àx¦s®æ,¨Ì§Ç§PÂ_¤p©ó90ªÌ,¦Û°Ê±N¨ä­È¥[1¨Ã¨ú¥N¸ÓÀx¦s®æ­ì­È;¦Ó¤j©ó100ªÌ,¦Û°Ê±N¨ä­È´î1¨Ã¨ú¥N¸ÓÀx¦s®æ­ì­È
·PÁÂ~

¦^´_ 1# kasa

¸Õ¸Õ¬Ý~
  1. Sub test()
  2.     For i = 1 To [a65536].End(xlUp).Row
  3.         If Cells(i, 1) < 90 Then
  4.             Cells(i, 1) = Cells(i, 1) + 1
  5.         ElseIf Cells(i, 1) > 100 Then
  6.             Cells(i, 1) = Cells(i, 1) - 1
  7.         End If
  8.     Next
  9. End Sub
½Æ»s¥N½X
PKKO

TOP

¥»©«³Ì«á¥Ñ tyrone123456 ©ó 2015-4-16 23:04 ½s¿è

VBA¼gªk¡G
1¡B¥ý½T»{¦³¦h¤Öµ§¸ê®Æ­n³B²z¡G     DataCount = application.counta(columns(1))
2¡B¨Ï¥ÎDo While ¡A§_«h±q²Ä1¦æ°µ¨ì65536¡A·|ªá«Ü¦h®É¶¡
I=0
Do while  I< DataCount
     if  cells(I+1,1)<>""  then
            if cells(I+1,1)<90   then
                     cells(I+1,1)=cells(I+1,1)+1
            elseif cells(I+1,1)>100 then
                    cells(I+1,1)=cells(I+1,1)-1
             end if
            I=I+1
    end if
loop
¥H¤W¼gªk¤]¥iÁ׶}Àx¦s®æ¦³¸õªÅ®æªº°ÝÃD

Excel¼gªk¡G
B1=if(A1<90,A1+1,if(A1>100,A1-1,A1))

TOP

¦^´_ 3# tyrone123456


    ¨Ï¥Î[A65536].END(XLUP).ROW¥u¬O¤@ºØ­pºâAÄæ³Ì¤U¤è­Èªº¦ì¸m,¹ê»Ú¤W¨Ã¤£·|µw©Ê°õ¦æ¨ì65536¦C(­n¬Ý³Ì¤U¤èªº­È¦b­þ¤@¦C)
PKKO

TOP

·PÁ¦U¦ì«e½ú«ü¾É,¦b¬Ý¦U¦ìªº«ü¾É¤§«e,§Ú¸ÕµÛ¼¶¼g¦p¤U,¦]¬°§Ú­è¦Û¾ÇVBA¥b¦~,¦³¿ù»~¤§³B,¦A½Ð¤j®a±Ð¾É¤@¤U~~·PÁÂ~

Sub °»¿ù()
Dim r As Integer
For r = 1 To Application.WorksheetFunction.CountA(Sheets("Sheet1").Range("E:E"))-1
        If Sheets("Sheet1").Cells(r + 7, 5) < Worksheets("°»¿ù³W®æ³]©w").Range("B2").Value Or Sheets("Sheet1").Cells(r + 7, 5) > Worksheets("°»¿ù³W®æ³]©w").Range("B1").Value Then
           Sheets("Sheet1").Cells(r + 7, 5) = Round(Rnd() * Worksheets("°»¿ù³W®æ³]©w").Range("B5").Value, 3) + Worksheets("°»¿ù³W®æ³]©w").Range("B4").Value
           
        End If
Next

End Sub

(ª`·N¨Æ¶µ)
1.¥ý½T»{EÄ椺¦@¿é¤J´Xµ§¸ê®Æ(µo²{¦X¨ÖÀx¦s®æ¤º¤§¼ÐÃD³Qºâ¬°1µ§¸ê®Æ)
2.¦]Sheet1¦³¼ÐÃD¦C,¬Gr+7¦C¬°¯u¥¿¼Æ¦r¸ê®Æ¿é¤J°_©l¦C
3."°»¿ù³W®æ³]©w"¤u§@ªí¤º¤§B1/B2¤À§O¬°³W®æ¤W¤U­­; B4¬°¶Ã¼Æ¤U­­,B5¬°¦Û¶Ã¼Æ¤U­­©¹¤W¼Æ°_,¦@­n¦ÛB5³]©w­È¤§²Õ¼Æ¤º¬D¤@­Ó¶Ã¼Æªº²Õ¼Æ¨Ì¾Ú
4.·íªì³]©w¶Ã¼Æ²£¥Í»Ý¦³¤p¼ÆÂI3¦ì,¬G¨Ï¥ÎRound¨Ó³W½d¶Ã¼Æ²£¥Í§e²{¤è¦¡

TOP

        ÀR«ä¦Û¦b : ¤£©È¨Æ¦h¡A¥u©È¦h¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD