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

[µo°Ý] ¿ý»s«á°j°é³]©w¤Î´¡¤J½Æ»sªºÀx¦s®æ¬O§_¥i¥H¤£´¡¤J¹Ï®×

[µo°Ý] ¿ý»s«á°j°é³]©w¤Î´¡¤J½Æ»sªºÀx¦s®æ¬O§_¥i¥H¤£´¡¤J¹Ï®×

·Q½Ð°Ý¯¸¤Wªº«e½ú­Ì
§Ú¦³¤@¿ý»sªº¥¨¶°·Q°µInputBox¼Æ¶q°j°é
½Ð°Ý¸Ó¦p¦ó½s¼g
  1. Sub ·s¼W¼Æ¶q()
  2.      Rows("1:47").Select
  3.     Selection.Copy
  4.     Rows("48:48").Select
  5.     Selection.Insert Shift:=xlDown
  6.         Range("A4").Activate
  7. End Sub
½Æ»s¥N½X
ÁÙ¦³§Ú¦b¤W­±ªº¥¨¶°¤¤¡A­t¨îªº½d³ò¦³¥]§t¨ì¹Ï¤ù¹Ï®×
¬O§_¦³¤£´¡¤J¹Ï¤ù¹Ï®×ªº¤è¦¡
¦]¬°ª½±µ±q48¦æ´¡¤J¡A´N¤£»Ý­n°µ¦æ¼Æ§P©w¡A¥i¥H¿ï¾Ü®æ¦¡³]©w

¥H¤W°ÝÃD¦A½Ð¤j¤jÀ°¦£¡A·PÁÂ~

¦^´_ 13# jackyq

§Ú§â¹q¸£­«·s¶}¾÷«á¡Aexcel´N¥¿±`¡A¨S¦³¿ù»~°T®§
©Ò¥H¤£·|¥d¦b¶K¤Wªºµ{¦¡§Ç¤W¤F

¤§«e¦]¬°¦³¿ù»~°T®§¡A©Ò¥H­è¦n¶]¨ì"´¡¤JªÅ¥Õ¦C"´N°±¤î¶K¤W¤F

¥Ø«eµ{¦¡¥H¥¿±`¹B§@¤F
·PÁ¦U¦ì¤j¤jªºÀ°¦£¡I¡I

TOP

¤èªk2
°²³] §Aªº¸ê®Æ¦C¦b 1 ~ 77 ³£¦³¸ê®Æ
¦pªG§A¦b 48 ¦C¥Î  Paste  ¶K¤J 30¦C
¨º»ò­ì¥ýªº 48 ~ 77 ¦C¸ê®Æ³£·|³QÂл\±¼

©Ò¥H
¥ý¥Î "´¡¤JªÅ¥Õ¦C" §â 48 ~ 77 ¦Cªº¸ê®Æ©¹«á²¾°Ê ( ´¡¤JµLªk¿ï¾Ü¤£¶K¹Ï, ©Ò¥H³o¸Ì¥u´¡¤JªÅ¥Õ¦C )
¦A¥Î PasteSpecial  §â¸ê®Æ½Æ»s¨ì ­è­è´¡¤JªºªÅ¥Õ¦C  ( PasteSpecial  ¥i¥H¿ï¾Ü¤£¶K¹Ï )

³o¼Ëµ²¦X´NÁ׶}¤F  insert ·|¶K¤J¹Ï¤ù, PasteSpecial  ·|Âл\±¼Â¦³ªº¸ê®Æ°Ï

TOP

¥»©«³Ì«á¥Ñ jackson7015 ©ó 2016-6-14 16:17 ½s¿è
¦^´_  ML089
¦^´_  jackyq
¥ý·PÁ¨â¦ì¤j¤jªº¨ó§U¡I

jackyq¤j¤jªº¤èªk1.¦bR_Insert.Insert Shift:=xl ...
jackson7015 µoªí©ó 2016-6-14 15:58


´ú¸Õ¦h¦¸«áµo²{¡A¤£¾å±o¬°¤°»ò´¡¤Jªºµ{¦¡³£·|¥X²{µ{¦¡¿ù»~¡A¾É­Pµ{¦¡Ãö³¬
Selection.Insert Shift:=xlDown
¦ý¬O¨Ï¥Î¤â°Ê½Æ»s´¡¤J«o¤£·|¦³¦¹°ÝÃD
¤£¾å±o¦³¤j¤j¦³³oºØ°ÝÃD§_?

TOP

¦^´_ 10# ML089
¦^´_ 10# jackyq
¥ý·PÁ¨â¦ì¤j¤jªº¨ó§U¡I

jackyq¤j¤jªº¤èªk1.¦bR_Insert.Insert Shift:=xlDown·|¥X²{¿ù»~¡A¾ã­Óµ{¦¡·|Ãö³¬¡A¤£¾å±o­ì¦]
¤èªk2.´¡¤J®É·|¥ý´¡¤J47¦CªºªÅ¥Õ¡AµM«á¤~¥¿±`´¡¤J½Æ»sªº®æ¦¡¡A¤£¾å±o­þ¸Ì»Ý­n§ó¥¿

ML089¤j¤jªº¤½¦¡´ú¸Õ«á¡Aµo²{¥u¦³½Æ»sªº°Ê§@¡A¨S¦³¥X²{¶K¤W©Î´¡¤Jªº°Ê§@

¥Ø«e·Q¨Ï¥Î¤èªk2ªº¤è¦¡§â´¡¤J¦¸¼Æ = [A2]¡AµM«á¦A°µ¤@¨Ç§P©w¿ï¶µ´N¦n¤F
¤£¹L¥Ø«e¤j¤jªº¤½¦¡¦n¹³¦³bug¡A·|¥X²{´¡¤JªÅ¥Õ¦C
¦A½Ð¤j¤jÀ°¦£¬Ý¬Ý¬O§_­þ¸Ì¦³¿ù»~¡A·PÁÂ~

TOP

¦^´_ 4# jackson7015
³o¼Ë¸Õ¸Õ

Sub ·s¼W¼Æ¶q()
    Dim Rng As Range
    Application.DisplayAlerts = False
    Set Rng = Rows("1:47")
    Rng.Copy
    Rows("48:48").Resize(, Rng.Rows.Count).PasteSpecial Paste:=xlPasteAll
    Application.DisplayAlerts = True
End Sub
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¤èªk2

Sub ·s¼W¼Æ¶q_2()
    ´¡¤J¦¸¼Æ = 5
        
    Set R_Copy = Rows("1:47")
    Set R_Insert = Rows("48:48")
   
    Application.CutCopyMode = False
    R_Insert.Resize(´¡¤J¦¸¼Æ * R_Copy.Rows.Count).Insert
    R_Copy.Select
    R_Copy.Copy
    Set R_Insert = R_Insert.Offset(-R_Copy.Rows.Count * ´¡¤J¦¸¼Æ)
    For w = 1 To ´¡¤J¦¸¼Æ
        R_Insert.PasteSpecial
        Set R_Insert = R_Insert.Offset(R_Copy.Rows.Count)
    Next
End Sub

TOP

¦^´_ 7# jackson7015

§Úª¾¹D§A¥Î insert ¬O¬°¤F¤è«K¤£¥Î­pºâ°Ï¶ô¤j¤p
¦ý insert ¦n¹³¨S¦³°Ñ¼ÆÅý§A¿ï¾Ü±Æ°£­þ¨Ç

    Sub ·s¼W¼Æ¶q()

    ´¡¤J¦¸¼Æ = 5
   
    Set R_Copy = Rows("1:47")
    Set R_Insert = Rows("48:48")
        
    For w = 1 To ´¡¤J¦¸¼Æ
    R_Copy.Select
    R_Copy.Copy
    R_Insert.Insert Shift:=xlDown
    Next
   
    Set R_Insert = R_Insert.Offset(-R_Copy.Rows.Count * ´¡¤J¦¸¼Æ)
    Set R_Insert = R_Insert.Resize(R_Copy.Rows.Count * ´¡¤J¦¸¼Æ)
    Call kill_Image(R_Insert)
End Sub


Sub kill_Image(ByVal R_«ü©w½d³ò As Range)


R_x1 = R_«ü©w½d³ò.Left
R_x2 = R_«ü©w½d³ò.Left + R_«ü©w½d³ò.Width
R_y1 = R_«ü©w½d³ò.Top
R_y2 = R_«ü©w½d³ò.Top + R_«ü©w½d³ò.Height

For Each p In R_«ü©w½d³ò.Parent.Pictures
    x1 = p.Left
    x2 = p.Left + p.Width
    y1 = p.Top
    y2 = p.Top + p.Height
   
    xx = x1 >= R_x1 And x1 <= R_x2 Or x2 >= R_x1 And x2 <= R_x2
    yy = y1 >= R_y1 And y1 <= R_y2 Or y2 >= R_y1 And y2 <= R_y2
  
    If xx And yy Then
       p.Delete
    End If
Next
End Sub

TOP

¦^´_ 6# jackyq
·PÁÂjackyq¤j¤j¼ö¤ßªºÀ°¦£
7¡B13ªº½T¥i¥H¨Ï¥Î¡F©Ò¦³®æ¦¡³£¯à[¶K¤W]
¥B¤£·|±a¤J¹Ï§Î

¥i¬O¤p§Ì»Ý­nªº¥\¯à¬O¥H´¡¤J½Æ»sÀx¦s®æªº¤è¦¡
³o¼Ë¤£¥Î¦A§PÂ_­n¦h¤Ö®æ¦b[¶K¤W]
¦]¬°»Ý­nªº­¶¼Æ¨C¦¸¤£©w
©Ò¥H·Q­n¥ý¥X²{InputBox¸ß°Ý´¡¤J¦h¤Ö¦¸
µM«á°µ°j°é¦¡ªº­«Âд¡¤J§Y¥i

¦ý¬O¿ý»sªº®É­Ôµo²{[´¡¤J½Æ»sªºÀx¦s®æ]¤£¯à³sÄò°Ê§@
½Æ»s¤@¦¸¥u¯à´¡¤J¤@¦¸¡A´N»Ý­n¦A½Æ»s¤@¦¸¤~¯àÄ~Äò°Ê§@
©Ò¥H·Q½Ð±Ð¤j¤j¬O§_¦³¿ìªk°µ¥X³sÄò´¡¤JÀx¦s®æ(¤£­n¹Ï§Î)ªº¤è¦¡

¤£µM¥i¯à´N­n°µ§PÂ_¦æ¼Æ«á¡A¥H[¶K¤W]ªº¤è¦¡°µ³B²z¤F

¥H¤W¤£¾å±o·|¤£·|»¡±o¤Ó½ÆÂø
¦A½Ð«e½ú­Ì¬Ý¬Ý¡A·PÁÂ~

TOP

¦^´_ 4# jackson7015

¤j¤j³o¼Ë¸Õ¸Õ¬Ý§a

........
    With Rows("48:48").Resize(, Rng.Rows.Count)    'columns/rows
        .PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    End With
Rows("48:48").PasteSpecial Paste:= 7
Rows("48:48").PasteSpecial Paste:= 13
Rows("48:48").PasteSpecial Paste:= .....  ' ³v¦¸²K¥[¯Ê¤Öªº
Rows("48:48").PasteSpecial Paste:= .....  ' ³v¦¸²K¥[¯Ê¤Öªº

°Ñ¼Æ¦Û¤v try
https://msdn.microsoft.com/en-us/library/bb241405%28v=office.12%29.aspx

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD