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

¿ý»sVBA¤p¤ò¯f

¿ý»sVBA¤p¤ò¯f

¦U¦ì¤j¤j¡A§Ú¿ý»sªº¥¨¶°¦p¤U¡A¤j·§¥\¯à´N¬OK2+L2,K3+L3...³Ì«á¦A¨ú¥NKÄæ¡A
§ÚªºVBA¥i¯à¿ýªº¤ñ¸ûÁà¡A¦ý¬O¥\¯à¤W¤j­P¬O¥i¥H¨Ï¥Îªº¡C

³Ì¤jªº°ÝÃD´N¬O Selection.AutoFill¤U©Ô¨ç¦¡ªº®É­Ô¡A
§Ú¨S¿ìªk½T©w³o­ÓÀɮצ³¦h¤Ö¦C¡A©Ò¥H¥¦·|¤@ª½¸É0¨ì9999¦C¡C
·Q½Ð°Ý³oÃþ«¬§P§O¬O§_¤@©w­n¨Ï¥Î°j°é¤~¯à¸Ñ¨M¡H

·PÁ¦U¦ì¡C

Sub ¥¨¶°2()
'
' ¥¨¶°2 ¥¨¶°
'

'
    Range("P2").Select
    Selection.NumberFormatLocal = "G/³q¥Î®æ¦¡"
    ActiveCell.FormulaR1C1 = "=RC[-5]+RC[-4]"
    Range("P2").Select
    Selection.AutoFill Destination:=Range("P2:P9999")
    Range("P2:P9999").Select
    Selection.Copy
    Range("K2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("L:M,P:P").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlToLeft
    Columns("A:A").ColumnWidth = 19.25
    Range("L:M,1:1048576").Select
    Range("O1").Activate
    Selection.Columns.AutoFit
    Selection.Rows.AutoFit
    With Selection.Font
        .Name = "·L³n¥¿¶ÂÅé"
        .Name = "Century Gothic"
   
    End With

    Range("A2").Select
End Sub

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-6-5 07:16 ½s¿è

¦^´_ 1# louiswei1986
§Ú¨S¿ìªk½T©w³o­ÓÀɮצ³¦h¤Ö¦C¡A©Ò¥H¥¦·|¤@ª½¸É0¨ì9999¦C
¥i¥HÆ[¹î¤u§@ªí¤Wªº¼Æ¾Ú«ü©w¦Û°Ê¶ñº¡Àx¦s®æ¦ì¸m
  1. Option Explicit
  2. Sub EX()
  3.     If Range("F1") > Range("P2").Row Then   '** Range("F1")ªº¼Æ­È > Range("P2").Row(¦C¸¹)
  4.         Range("P2").AutoFill Range("P2:P" & Range("F1"))
  5.     End If
  6. End Sub
  7. '*****************
  8. Sub EX_1()
  9.     If Range("F1") > 0 Then  '** Àx¦s®æ¶i¦æ¦Û°Ê¶ñº¡ªº¦C¼Æ
  10.          With Range("P2")
  11.             .AutoFill .Cells.Resize(Range("F1"))
  12.         End With
  13.     End If
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


    ¶W¯Åª©¥D±z¦n¡A¤p§Ì·M¾|¡A
¤£ª¾¹DF1¬O­þ¸Ì¨Óªº©O¡H
´ú¸Õ³o¨â­Ó¥¨¶°³£¬O®Ú¾ÚF1ªº­È¨Ó¹Bºâ¦h¤Ö¦C¡A
§Úªº»Ý¨D¬O§Æ±æ¥L¯à­pºâ¨ì¥HBÄ欰¥D¡A
¦pªGBÄæ¬OªÅ¥Õ´N°±¤î¡C

¦AÀµ½Ð«üÂI¡C
¡§Since I¡¦m inarticulate, I express myself with images¡¨ ¡V Helen Levitt

TOP

¦^´_ 3# louiswei1986
¥i¥HÆ[¹î¤u§@ªí¤Wªº¼Æ¾Ú«ü©w¦Û°Ê¶ñº¡Àx¦s®æ¦ì¸m

°²³]Range("F1") ¦p¦³¤½¦¡=COUNTA(P2:P65536)

¶·¨Ì§A¤u§@ªí¨Ó§PÂ_
  1.   With Range("P2")
  2.            .AutoFill .Cells.Resize( ­n±a¤Jªº¼Æ­È )
  3.        End With
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE


    ¦nªº¡A¦A¹Á¸Õ¬Ý¬Ý¡A·PÁ¡C
¡§Since I¡¦m inarticulate, I express myself with images¡¨ ¡V Helen Levitt

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD