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

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

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

¦^´_ 9# Hsieh


    ¬Oªº§Ú­n­pºâªº°Ï¶ô¤w¸g¥ÎªÅ¥Õ¦C°Ï¹j
     ©Ò¥H¬O¤j¤jªºÂ²³æ¤è¦¡
     ¤£¹L¦A³o¸Ì¬Ý¨ì«Ü¦h¤£¤@¼Ëªº³B²z¤è¦¡
     ¯u¬OÁÙ¦³ªº¾Ç
     ÁÂÁ³á
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

°Ï¶ô¬J¥HªÅ¥Õ¦C°Ï¹j
r = [A65536].End(xlUp).End(xlUp).Row
[A65536].End(xlUp).Offset(1, 6).Resize(, 4) = Array("¤p­p", "=SUM(R" & r & "C:R[-1]C)", "=SUM(R" & r & "C:R[-1]C)", "=RC[-2]/RC[-1]")
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-3-3 14:39 ½s¿è
¦^´_  GBKEE
Range("G5:G" & Rows.Count) ¥i¥H¥ÎColumns("G:G")¨ú¥N¶Ü ³o¨â¦U¤è¦¡¦³­þ¸Ì¤£¦P¶Ü?
...
freeffly µoªí©ó 2011/3/3 12:17

¬O¥i¥H¥ÎColumns("G:G")¨Ó¨ú¥Nªº,¦ý¦pg1:g3¦³¼Æ¦r ·|¥¢±¼·Ç½T©Ê
End(3)(2).Resize(, 4)=>.End(xlUp).Cells(2, 1).Resize(1, 4)

TOP

¦^´_ 5# oobird
§Úªº¸ê®Æ°ò¥»¤W¬O­pºâ"o"
¦ý¬O²Ä¤@¶ô°Ï°ì¤]¦³¥i¯à§t¦³"o"ªº³¡¥÷(¤£¦C¤J­pºâªº³¡¥÷)
©Ò¥H§Ú­ì¥»·Qªº¤è¦¡¬O±q²Ä¤G¶ô°Ï°ì¥h­pºâ ¨Ã¥B­pºâ²Ä¤G¶ô°Ï°ìªº¦C¼Æ
¤£¹LÁÙ¬O±q¦U¦ì¤j¤jªº¤è¦¡¬Ý¨ì¦Û¤v¨S¥Î¹Lªº¤è¦¡
¥i¥H°Ý¤@¤UEnd(3)(2).Resize(, 4) ³o¦U¬O¤°»ò·N«ä¶Ü?
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 3# GBKEE


    Range("G5:G" & Rows.Count) ¥i¥H¥ÎColumns("G:G")¨ú¥N¶Ü ³o¨â¦U¤è¦¡¦³­þ¸Ì¤£¦P¶Ü?
    sum(" & R.Offset(, i - 1).Address & ")³oºØ¥Îªk§Ú¤£·|­C¥i¥H¸Ñ»¡¤@¤U¶Ü
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

mrow = [g:g].Find("o", , , 1).Row
[g65536].End(3)(2).Resize(, 4) = Array("¤p­p", "=sum(r" & mrow & "c:r[-1]c)", "=sum(r" & mrow & "c:r[-1]c)", "=rc[-2]/rc[-1]")

TOP

§Ú¥u·Q¹ï¤U­±¨º¶ô°Ï°ì°µ¤p­pªº°Ê§@
¤£¹L³o¦U¤èªk¤]¬O§Ú·Qª¾¹Dªº
ÁÂÁÂ

¦pªG¥u·Q¹ï³Ì¤U­±ªº°Ï°ì°µ¤p­p°Ê§@
­n°µ­þ¤@¦U­×§ï©O?
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 1# freeffly
  1. Sub EX()
  2.     Dim R As Range, i As Integer
  3.     For Each R In Sheet3.Range("G5:G" & Rows.Count).SpecialCells(xlCellTypeConstants).Areas
  4.         R.Cells(R.Count + 1, 1) = "¤p­p"
  5.         For i = 2 To 4
  6.              R.Cells(R.Count + 1, i) = "=sum(" & R.Offset(, i - 1).Address & ")"
  7.         Next
  8.     Next
  9. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD