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

[µo°Ý] (¤w¸Ñ¨M)¯B°Ê°Ï°ìªº§@·~

¦^´_ 8# GBKEE

      ¤F¸Ñ
       ¨º¤U­±³o¦U¦³¿ìªk»¡©ú¶Ü ÁÙ¬O¥u¯à¥Î­Iªº?
     sum(" & R.Offset(, i - 1).Address & ")³oºØ¥Îªk§Ú¤£·|­C¥i¥H¸Ñ»¡¤@¤U¶Ü
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-3-3 19:53 ½s¿è

¦^´_ 11# freeffly
³o¬Ovbaªº»¡©ú
expression.Offset(RowOffset, ColumnOffset)   
expression     ¥²¿ï¡C¸Ó¹Bºâ¦¡¶Ç¦^ Range ª«¥ó¡C
RowOffset      ¿ï¾Ü©Êªº Variant¡C¥Î¦C¼Æªí¥Üªº°Ï°ì¦ì²¾ (¥¿­È¡B­t¼Æ©Î¹s (0))¡C¥¿­Èªí¥Ü¦V¤U¦ì²¾¡A­t­Èªí¥Ü¦V¤W¦ì²¾¡C¹w³]­È¬° 0¡C
ColumnOffset      ¿ï¾Ü©Êªº Variant¡C¥ÎÄæ¼Æªí¥Üªº°Ï°ì¦ì²¾ (¾ã¼Æ¡B­t¼Æ©Î 0 (¹s))¡C¥¿­Èªí¥Ü¥k¦ì²¾¡A­t­Èªí¥Ü¥ª¡C¹w³]­È¬° 0¡C

expression.Address(RowAbsolute, ColumnAbsolute, ReferenceStyle, External, RelativeTo)
expression    ¥²¿ï¡C¦¹¹Bºâ¦¡·|¶Ç¦^¤W­z¨ä¤¤¤@­Óª«¥ó¡C
RowAbsolute    ¿ï¾Ü©Êªº Variant¡C­Y¬° True «h¥Hµ´¹ï°Ñ·Ó¼Ò¦¡¶Ç¦^¹ï¦Cªº°Ñ·Ó¡C¹w³]­È¬° True¡C
ColumnAbsolute    ¿ï¾Ü©Êªº Variant¡C­Y¬° True «h¥Hµ´¹ï°Ñ·Ó¼Ò¦¡¶Ç¦^¹ïÄ檺°Ñ·Ó¡C¹w³]­È¬° True¡C
ReferenceStyle    ¿ï¾Ü©Êªº XlReferenceStyle ¡C
XlReferenceStyle ¥i¥H¬O³o¨Ç XlReferenceStyle ±`¼Æ¤§¤@¡C
xlA1 ¹w³]­È¡C¨Ï¥ÎxlA1 ¥i¶Ç¦^ A1 ¼Ë¦¡ªº°Ñ·Ó¡C
xlR1C1¡C¨Ï¥Î xlR1C1 ¥i¶Ç¦^ R1C1 ¼Ë¦¡ªº°Ñ·Ó¡C

External    ¿ï¾Ü©Êªº Variant¡C­Y¬° True «h¶Ç¦^¥~³¡°Ñ·Ó¡C­Y¬° False «h¶Ç¦^°Ï°ì°Ñ·Ó¡C¹w³]­È¬° False¡C
RelativeTo    ¿ï¾Ü©Êªº Variant¡C¦pªG RowAbsolute ©M ColumnAbsolute ¬° False¡A¥B ReferenceStyle ¬° xlR1C1¡A«h¥²¶·¥[¤J¬Û¹ï°Ñ·Óªº°_©lÂI¡C¥»¤Þ¼Æ§Y¬°©w¸q°_©lÂIªº Range ª«¥ó¡C

¥H¤U¬O§Úªº»¡©ú''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
R.Offset(, 2)   ->Rªº½d³ò ¦V¥k²¾°Ê2Äæ
R.Offset(1, 2) ->Rªº½d³ò ¦V¥k²¾°Ê2Äæ ¦V¤U²¾°Ê1¦C

R.Offset(, 2).Address     ->Rªº½d³ò ¦V¥k²¾°Ê2Ä檺µ´¹ï¦ì¸m
R.Offset(1, 2)).Address  ->Rªº½d³ò ¦V¥k²¾°Ê2Äæ ¦V¤U²¾°Ê1¦Cªºµ´¹ï¦ì¸m

TOP

¦^´_ 12# GBKEE


   ÁÂÁÂ
    ¦³ÂI¬ÝÀ´¤F
   ¥D­n¬ORªº°Ï°ìªº²¾°Ê¥[Á`
    ¥i¥H³o¼Ë»¡¶Ü
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 13# freeffly
¹ïªº

TOP

¦^´_ 14# GBKEE


    ÁÂÁÂ
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 1# freeffly
¦pªG¼Ó¥D¦³ªÅªº¸Ü,¥i§_¸Õ¸Õ§Ú³o­Ó§@«~,¦³¿ùªº¸Ü½Ð³qª¾§ÚÅý§Ú§ï¥¿
  1. Sub abc()
  2. Dim myrange As Range, downlimit As Range, uplimit As Range, rightlimit As Range, myregion As Range
  3. Dim a, h, i

  4. Set myrange = Range("a65536").End(xlUp)

  5. Do
  6. Set downlimit = myrange
  7. Set uplimit = downlimit.End(xlUp)
  8. Set rightlimit = downlimit.End(xlToRight)
  9. Set myregion = Range(uplimit, rightlimit)

  10. h = 0
  11. i = 0

  12. For Each a In Range(uplimit, downlimit)
  13. If a.Offset(, 6) = "O" Then
  14.     h = h + a.Offset(, 7).Value
  15.     i = i + a.Offset(, 8).Value
  16. End If
  17. Next

  18. If h <> 0 Then
  19. downlimit.Offset(1, 6) = "¤p­p"
  20. downlimit.Offset(1, 7) = h
  21. downlimit.Offset(1, 8) = i
  22. downlimit.Offset(1, 9) = h / i
  23. downlimit.Offset(1, 7).Interior.ColorIndex = 6
  24. downlimit.Offset(1, 8).Interior.ColorIndex = 6
  25. downlimit.Offset(1, 9).Interior.ColorIndex = 6
  26. End If

  27. Set myrange = uplimit.End(xlUp)
  28. Loop While myrange.Address <> "$A$1"
  29. End Sub
½Æ»s¥N½X
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 16# FAlonso


    §Ú¥u­n¥[Á`³Ì«á¨Ì°Ï¶ô
      §Aªº¤è¦¡¦n¹³¬O°w¹ï"O"¶i¦æ¥[Á`
      §Ú­è¬Ý§Oªº°Ï¶ô¥[Á`¦n¹³¦³°ÝÃD
      §Aªº¤è¦¡¦n¹³¦³ÂIÃþ¦ü¥t¤@¦ì¤j¤j¦ý¬O¤S¦³¨Ç®t²§
      ©ú¤Ñ¦b§i¶D§A®t¦b­þ¸Ì
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 17# freeffly
§Ú²q·Q©Î³\¤u§@ªí¤¤¦³«Ü¦h°Ï¶ô,·í¤¤¤@¨Ç¤S­n¹ïO§@­pºâ,©Ò¥H¼g¦¨¤Floop
¥u¹ï³Ì¤U¼h°Ï°ì§@¤p­p,§â7/33/34¦æªºµ{¦¡§R±¼«K¦æ
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 18# FAlonso


    Àɮפº§Ú¦³»¡©ú
     ½Ð¬ÝÀɮקa

¯B°Ê°Ï°ì°ÝÃD.rar (16.74 KB)

¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 19# freeffly
§â§Úªºµ{¦¡­×§ï¤@¤U.Åܦ¨
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD