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

¥¨¶°ÅܼưÝÃD

¥¨¶°ÅܼưÝÃD

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2018-4-23 19:41 ½s¿è

Sub ¥¨¶°2()

    ActiveCell.FormulaR1C1 = "=RC[-1]/2"
    Range("D6").Select
    Selection.AutoFill Destination:=Range("D6:D69478")
    Range("D6:D69478").Select
End Sub

«e­±ªºA¡AB¡ACÄd³£¦³¸ê®Æ

¥H¤W¬O§Ú¤@­Ó³B²z¸ê®Æªº¥¨¶°¡A·Q½Ð±Ð¤@¤Uª©¤W¤j¤j¡Aµ{¦¡½X¸Ì­±=Range("D6:D69478")¡A¦]¬°¸ê®Æªº¦h¹è¤£¤@¡A¦pªG§Ú­n§âD69478§ï¦¨ÅܼƦӤ£¬O¹³²{¦bªº©T©w¼Æ­n«ç»ò§ï??

§Ú¦³·Q¹L¥ý¥ÎCOUNT¨ç¥Ü¥ýºâ¥X¨ÓCÄd¦³¦h¤Ö¼Æ¾Ú¡A¦ý¬O§Ú¤£ª¾¹D¦p¦ó§â¨ç¼Æ¥[¨ì¸Ì­±¡A§Ú­ì¥ý¬O§â¥¦§ï¦¨=Range("D6:"D"&COUNT(C5:C90000)")¡A¦ý¦n¹³¤£¦æ¡A©Ò¥H½Ð±Ðª©¤W¤j¤j­n¦p¦ó§ó§ï

¦^´_ 1# ÂŤÑÄR¦À

¥i¥H§ï¥Îcells»yªk¡A·|¤ñ¸û¦³¼u©Ê
¥t¥~¡A¦pªG­n¨ú±o³Ì«á¤@¦C¥i¥Îcells(rows.count,4).end(xlup).row
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

¦^´_ 1# ÂŤÑÄR¦À
  1. Option Explicit
  2. Sub Ex()
  3.     'With ³¯­z¦¡ : ¤@­Óª«¥ó©Î¨Ï¥ÎªÌ¦Û­q«¬ºAªº¦WºÙ
  4.     With Range("D6")
  5.         .FormulaR1C1 = "=RC[-1]/2"
  6.         If .Cells.End(xlDown).Row = Cells(Rows.Count, .Column).End(xlUp).Row Then
  7.             '¸ê®Æ°Ïªº¸ê®Æ¨S¤¤Â_¦³³sÄò,¥i±q¤W©¹¤U¨ì¸ê®Æ°Ïªº³Ì«á¤@µ§¸ê®Æ
  8.             ' .Cells.End(xlDown)  *** ¦³¤@ÂI .Cells ¬O Withª«¥óªº Cells ***
  9.             .AutoFill Destination:=Range(.Cells, .Cells.End(xlDown))
  10.         Else
  11.              '¸ê®Æ°Ïªº¸ê®Æ¦³ªÅ¥Õ¸ê®Æ,¥²»Ý¥Ñ¤u§@ªí©³³¡¥Ñ¤U©¹¤W¨ì¸ê®Æ°Ïªº³Ì«á¤@µ§¸ê®Æ
  12.              '** Cells(Rows.Count, .Column)  ** ->  Cells(¤u§@ªíªº¦C¦ìÁ`¼Æ, Range("D6")ªºÄæ¦ì¼Æ)
  13.              '** Cells³o¸Ì¨S¤@ÂI . ¬O¤u§@ªíªº Cells ¤£¬ORange("D6")ªº Cells**
  14.              '** ¦³¤@ÂI  .Column ¬ORange("D6")ªº Äæ¦ì **
  15.             .AutoFill Destination:=Range(.Cells, Cells(Rows.Count, .Column).End(xlUp))
  16.         End If
  17.     End With
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

Range("D6:D" & Cells(Rows.Count, 1).End(xlUp).Row).FormulaR1C1 = "=RC[-1]/2"

TOP

¦^´_ 4# ­ã´£³¡ªL
­ã¤j¡A·PÁ§A¡A¯uµR§Qªº¸Ñµª

TOP

¦^´_ 3# GBKEE


    G¤j¡A·PÁ§A¡A¦n¤[¨S¤W¨Ó¤F¡A³Ìªñ²´·ú¦³¤ñ¸û¦n¤F¶Ü??

TOP

¦^´_ 6# ÂŤÑÄR¦À

ÁÂÁ§AªºÃö¤ß,ÁÙ¦n´N¿Ã¹õ¤£¥i¨n ¤Ó¤[.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE

G¤j¡A¥i¥H³Â·Ð§A¦³®É¶¡À°§Ú¬Ý¬Ý¦n¶Ü?? ·PÁÂ
    http://forum.twbts.com/viewthrea ... mp;extra=#pid105281

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD