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

[µo°Ý] ¸ê®Æªº½Æ»s¡B¶K¤W¡A»yªk°ÝÃD

¥»©«³Ì«á¥Ñ n7822123 ©ó 2019-6-20 03:02 ½s¿è

¦^´_ 3# iceandy6150


¦b«D±Ò¥Îªº¤u§@ªí°µ¿ï¨ú¡A·|µo¥Í¿ù»~

©Ò¥HºÉ¶q¤£­n¥Î Select¡A¤U­±µ{¦¡¦P²z¡A¸Õ¸Õ¬Ý

Sheets("¤u§@ªí1").Activate
Sheets("µ²ªG°Ï").Range("A1").Select


¿ï¨ú¤§«e¡A­n¥ý§ï±Ò¥Îªº¤u§@ªí¡A
§ï¦¨¤U­±³o¼Ë´N¥i¥H¤F

Sheets("¤u§@ªí1").Activate
Sheets("µ²ªG°Ï").Activate
Sheets("µ²ªG°Ï").Range("A1").Select
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 2# n7822123


    ·PÁ¤j¤jÁ¿¸Ñ¡A­ì¨Ó³W«h¬O³o¼Ë

¦^¨ì§Ú²Ä¤@ÃD
  1. With Sheets("¤u§@ªí1")

  2. a = .UsedRange.Rows.Count
  3. Sheets("µ²ªG°Ï").Range("A1:Z200").Delete Shift:=xlShiftUp    '²M°£©Ò¦³¸ê®Æ
  4. Sheets("¤u§@ªí1").Range("A1:B" & a).Copy
  5. Sheets("µ²ªG°Ï").Range("A1").Select
  6. Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
  7. , SkipBlanks:=False, Transpose:=False

  8. Application.CutCopyMode = False
  9. End with
½Æ»s¥N½X
»¡¿ù¦b¨º¤@¦æ
Â^¨ú.JPG

¬O¦]¬°¥Î¤F With Sheets("¤u§@ªí1")
©Ò¥H§ÚSheets("µ²ªG°Ï").Range("A1").Select ³o¼Ë´N·|¿ù¶Ü?
ÁÙ¬O¥t¦³­ì¦]
ÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2019-6-20 01:26 ½s¿è

¦^´_ 1# iceandy6150

¥i¬O¦b³o¤@¦æ¸ò§Ú»¡¥X¿ù  Sheets("µ²ªG°Ï").Range("A1").Select
¬°¤°»ò©O?

a = .UsedRange.Rows.com
À³¸Ó¬O
a = .UsedRange.Rows.count


¤G¡B¤£¦PÀɮפ§¶¡ªº½Æ»s¡B¶K¤W

§AªºÃD¥Ø¹ê¦b¤Ó¼s¤F.......¼gªk¤d¦ÊºØ
¥u¯à»¡·s¤â¥u¯à¦h¬Ý§O¤H«ç»ò¼gªº
³Ì«á¤~¯à§ä¨ì¦Û¤v²ßºDªº¼gªk


­ìµ{¦¡:
Windows("¸ê®Æ.xlsx").Activate
.Range("A1:B3").copy

Windows("ÀÉ®×.xlsx").Activate
.Range("A1").select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False

(1)¥i¥H³]ª«¥ó¨Ó²µuªø«× ¦p¤U:

Set ¸ê®Æªí=workbooks("¸ê®Æ.xlsx").sheets("¤u§@ªí1")
Set Àɮתí=workbooks("ÀÉ®×.xlsx").sheets("¤u§@ªí1")
¸ê®Æªí.[A1:B3].copy
Àɮתí.[A1].PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False



(2)¦pªG±Ò¥Îªº¤u§@ªí¦b"¸ê®Æ.xlsx"ªº"¤u§@ªí1"¡A
     °ò¥»¤W¥H«á¥Î³o­Ó¤u§@ªí¡A«e­±ªº"¦a§}"´N¥i¥H¬Ù²¤¤F
     ¥ÎActivate+With...End With ¨Ó²µuªø«× ¦p¤U


workbooks("¸ê®Æ.xlsx").sheets("¤u§@ªí1").Activate

with workbooks("ÀÉ®×.xlsx").sheets("¤u§@ªí1")
    [A1:B3].copy  
    .[A1].PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
    , SkipBlanks:=False, Transpose:=False  
end with



[A1:B3].copy  ³o¸Ì¬Ocopy "¸ê®Æ.xlsx"ªº"¤u§@ªí1"ªº[A1:B3]¡A¦]¬°¬O±Ò¥Îªº¤u§@ªí¡A«e­±ª½±µ¬Ù²¤!
ª`·N[A1]«e­±¦h¤F.¡A©Ò¥H¬O¦b"ÀÉ®×.xlsx"ªº"¤u§@ªí1"ªº[A1]¶K¤W
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD