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

¥[¦CªºÁ`©M

¥[¦CªºÁ`©M

¥»©«³Ì«á¥Ñ mdr0465 ©ó 2018-4-1 23:41 ½s¿è

¦U¦ì:

½Ð°Ý¦pªG§Ú·Q¼g¤@±ø¬qµ{¦¡,«Y¥ÑA2¦Ü¨ì³Ì«á¤@Äæ²Ä¤G¦Cªº¼Æ­È,§ÚÀ³¸ÓÂI¼g©O?

ÁÂÁÂ

For ss = 1 To column
'        For xx = 1 To cnt
'             Cells(ss + 1, xx) =........................
'    Next
   

¦^´_ 1# mdr0465

¬O­n­pºâ¨C¦CC¨ìFÄ檺¥[Á`,µ²ªGÅã¥Ü¦bGÄæ¶Ü??
¦pªG¬O,´£¨Ñ°Ñ¦Ò
Sub ex()
r = [a65535].End(3).Row
[G2].Resize(r - 1) = "=sum(C2:F2)"
End Sub

TOP

Hi Jcchiang:

ÁÂÁ§Aªº¦^ÂÐ, ¦ý§Ú·Qªº¬O³Ì«á¤@¦æ"¦X­p" ¬O¥["¤H¦W"ªº´X¦æ, ¦]¬°§Ú¤v¸g¼g¤F¤@­Óµ{¦¡¬O¥ô·N¥[¤H¦W,¦ÓÀHµÛ¥[¤H¦W¦ÓÄæ¼Æ·|¬Û¹ï¼W¥[¦Ó"¦X­p"ÊúÄæ¦ì¥ç¬Û¹ï·|§ïÅÜ,ÁÂÁÂ

TOP

¦^´_ 3# mdr0465
§Aªº¹Ï¨Ò¬O§t¥Í²£¥ó¼Æ¤]¥[¤J,¦pªG¤£»Ý¥[¥Í²£¥ó¼Æ,½Ð±NActiveCell.FormulaR1C1 = "=SUM(RC[" & (3 - y) & "]:RC[-1])"
§ï¬°ActiveCell.FormulaR1C1 = "=SUM(RC[" & (4 - y) & "]:RC[-1])"

Sub ex()
Dim x, y
x = Range("a1").CurrentRegion.Rows.Count '­pºâ¨Ï¥Îªº¦C¼Æ
y = Range("a1").CurrentRegion.Columns.Count '­pºâ¨Ï¥ÎªºÄæ¼Æ
Cells(2, y).Select
ActiveCell.FormulaR1C1 = "=SUM(RC[" & (3 - y) & "]:RC[-1])" '¦X­p
Selection.AutoFill Destination:=Range(Cells(2, y), Cells(x, y)), Type:=xlFillDefault '±N¤½¦¡©ñ¤J©Ò¦³¦X­pÄæ¦ì
End Sub

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD