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

©R¥O«ö¶s·í¤¤,¦p¦ó¯à±NSheet1½Æ»s¨ìSheet2

©R¥O«ö¶s·í¤¤,¦p¦ó¯à±NSheet1½Æ»s¨ìSheet2

©R¥O«ö¶s·í¤¤,¦p¦ó¯à±NSheet1½Æ»s¨ìSheet2, ¥H¤U¼gªk·|¥X²{¿ù»~, ¸Ó«ç»ò¼g¤~¦n?

Private Sub CommandButton1_Click()

    Sheets("Sheet1").Select
    Range("A1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy

    Sheets("Sheet1").Select
    Range("A11").Select
    ActiveSheet.Paste
   
End Sub

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-2-16 16:46 ½s¿è

¦^´_ 1# openpc
  1. Private Sub CommandButton1_Click()
  2.     Sheets("Sheet1").Select
  3.     Range("A1").Select
  4.     Range(Selection, Selection.End(xlToRight).End(xlDown)).Select
  5.     Selection.Copy
  6.     Sheets("Sheet1").Select  
  7.     '   Sheets("Sheet2").Select   '<-½Æ»s¨ìSheet2
  8.     Range("A11").Select
  9.     ActiveSheet.Paste
  10. End Sub
½Æ»s¥N½X

TOP

Private Sub CommandButton1_Click()

    Sheets("Sheet1").Select
    Range("A1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy

    Sheets("Sheet2").Select  '==>·PÁ«ü¥¿¿ù»~
    Range("A11").Select
    ActiveSheet.Paste
End Sub
¥i¬O, §Ú¬O¦bCommandButton1_Click()ªº±¡ªp¤U°õ¦æ·|¦³,
°õ¦æ¶¥¬q¿ù»~'1004'
Class Range ªºSelect¤èªk¥¢±Ñ

½Ð±Ð¥ý¶i,¦p¦ó¸Ñ.

TOP

¦^´_ 3# openpc
½Ð¦h°Ñ¦Ò    ·s¤â VBA ¤Jªù±`¨£°ÝÃD
§A­×§ïµ{¦¡ ©ñ¦bThisWorkbook ©Î¤@¯ë²Õ ¬O¤£·|¦³¿ù»~ªº
¦pµ{¦¡½X¦bSheet1 ¶·§ï¦¨
  1. Private Sub CommandButton1_Click()
  2.     Sheets("Sheet1").Select
  3.     Range("A1").Select
  4.     Range(Selection, Selection.End(xlToRight).End(xlDown)).Select
  5.     Selection.Copy
  6.     'Sheets("Sheet1").Select
  7.      With Sheets("Sheet2")
  8.         .Select   '<-½Æ»s¨ìSheet2
  9.         .Range("A11").Select
  10.     End With
  11.     ActiveSheet.Paste
  12. End Sub
½Æ»s¥N½X

TOP

¦hÁ«üÂI, §Ú·|¦h¦h°Ñ¦Ò·s¤â VBA ¤Jªù±`¨£°ÝÃD.

½Ð±Ð¥ý¶i,
¦pµ{¦¡½X¦bSheet3
3#ªº02.Sheets("Sheet1").Select, ­n¦p¦ó­×§ï

TOP

¦^´_ 5# openpc
¤Gµ{¦¡®ÄªG¤@¼Ë
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     With Sheets("Sheet1")
  4.         .Range("A1", .Range("A1").End(xlToRight).End(xlDown)).Copy Range("A11")
  5.         ' Range ("A11") :  µ{¦¡½X¦bSheet3  ´N¬OSheet3ªºRange ("A11")
  6.     End With
  7. End Sub
  8. Private Sub Ex()  '¦³«ü©w¤u§@ªí ©ñ¦ó³B³£¥i¥H
  9.        ' Sheets("Sheet1").Range("A1", Sheets("Sheet1").Range("A1").End(xlToRight).End(xlDown)).Copy  Sheet3.Range("A11")
  10.       '   ¤W¦¡µ{¦¡½Xµ¥¦P ¥H¤Uµ{¦¡½X
  11.     With Sheets("Sheet1")
  12.         .Range("A1", .Range("A1").End(xlToRight).End(xlDown)).Copy Sheet3.Range("A11")
  13.     End With
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# openpc

¤£¬O±NSheet1ªº¤º®e½Æ»s¨ìSheet2ªºA11¶Ü?
¥u­n¦b³o­Ó¬¡­¶Ã¯¥ô¦óµ{§Ç¤¤°õ¦æ¤U¦C»y¥y´N¬O¤F
  Sheets("Sheet1").Range("A1").CurrentRegion.Copy Sheets("Sheet2").Range("A11")
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

½Ð±Ð¥u­nRange("A1"¨ì"A10"),   ¨Ï¥ÎSheets("Sheet1").Range("A1").CurrentRegion.Copy Sheets("Sheet2").Range("A11")ªº¼Ò¦¡¸Ó¦p¦óªí¹F, ·PÁ¦A·PÁÂ!

TOP

¦^´_ 8# openpc

Sheets("Sheet1").Range("A1:A10").Copy Sheets("Sheet2").Range("A11")
©Î
Sheets("Sheet1").Range("A1", "A10").Copy Sheets("Sheet2").Range("A11")
©Î
Sheets("Sheet1").Range("A1").Resize(10, 1).Copy Sheets("Sheet2").Range("A11")

¥þ³¡¶K¤W

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD