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

[µo°Ý] ±Ð²¾°Ê¤u§@ªí¥X²{ Class worksheetªºMove¤èªk¥¢±Ñ "104"

½Ð±Ð²¾°Ê¤u§@ªí¥X²{--°õ¶¥¬q¿ù»~'1004'--ªº¿ù»~

¨Ï¥Î move  ®É¥X²{¤F¿ù»~°T®§~~~~~²¾°Ê¤u§@ªí¥X²{--°õ¶¥¬q¿ù»~'1004'--ªº¿ù»~
Workbooks("¥Dµ{¦¡.xls").Sheets("¸ê®Æªí3").Move before:=Workbooks("·s¼W¸ê®Æ.xls").Sheets("¸T§R")  '²¾°Ê   ¤u§@ªí======>¥X²{  °õ¶¥¬q¿ù»~'1004'
¨C¤@¦¸³£¥X²{¦b¦P¤@­Ó¦a¤è¡I¦ü¥G·h²¾  move¡Bcopyµ¥¥Îªk¦³¦¸¼Æªº­­¨î¡H
«çºN·|³o¼Ë¡A¦³¤°»ò¤èªk§ïµ½¶Ü¡H
¥H¤U¬°¬ÛÃö¸ê®Æ¦pªþ¥ó
ÁÂÁ«ü±Ð~~~~·P®¦~~~~~~~¡I


°Ý°ÝÃD.rar (15.31 KB)

TOP

¥»©«³Ì«á¥Ñ mark15jill ©ó 2013-2-18 15:22 ½s¿è

¦^´_ 1# ji12345678

  ¦]¬°¼Ó¥D©Ò¸ß°Ý¤§°ÝÃD¡A¨ÃµL»¡©ú¨â­ÓÀɮ׬O§_¦P®É¶}±Òª¬ºA
  ¥H¤Uµ{¦¡½X¥i°Ñ¦Ò¬Ý¬Ý¡A¦ý­n¥ý±N¨â­ÓÀɮ׶}±Ò
  1. Sub ¶×¤J()

  2. Get_Path_LEN = Len(Trim(Application.ActiveWorkbook.FullName))    '¨ú±oÀɮק¹¾ã¦W¸ô®|¤Î¦WºÙ
  3. Get_data_name_LEN = Len(Trim(Application.ActiveWorkbook.Name))        '¨ú±o ÀÉ®×  ¦WºÙ
  4. Full_path_name = Left(Trim(Application.ActiveWorkbook.FullName), Get_Path_LEN - Get_data_name_LEN) '¨ú±o §¹¾ã¸ô®|
  5.    
  6. Get_data_name_COM = Application.ActiveWorkbook.Name   '¨ú±oÀɦW----------
  7. 'For x = 1 To 100
  8. Open_old_data = Full_path_name & "·s¼W¸ê®Æ.xls"
  9. Workbooks.Open Open_old_data  ' ¶}±Ò¸ê®Æ

  10.     Windows("¥Dµ{¦¡.xls").Activate
  11.         Sheets("¸T§R").Select
  12.     Windows("·s¼W¸ê®Æ.xls").Activate
  13.     Sheets(Array("¸ê®Æªí1", "¸ê®Æªí2", "¸ê®Æªí3", "¸ê®Æªí4", "¸ê®Æªí5")).Select
  14.     Sheets("¸ê®Æªí5").Activate
  15.     Sheets(Array("¸ê®Æªí1", "¸ê®Æªí2", "¸ê®Æªí3", "¸ê®Æªí4", "¸ê®Æªí5")).Copy Before:=Workbooks( _
  16.         "¥Dµ{¦¡.xls").Sheets(3)
  17.     Windows("·s¼W¸ê®Æ.xls").Activate
  18.     ActiveWindow.Close
  19.    
  20.    
  21.    
  22.      Application.DisplayAlerts = False  'Ãö³¬Äµ§iµøµ¡
  23.      'Workbooks("·s¼W¸ê®Æ.xls").Sheets("¸T§R").Delete  '¤U¸üªº¸ê®Æ(§R°£  ¸T§R  ªº¤u§@ªí)
  24.      Application.DisplayAlerts = True  '«ì´_ĵ§iµøµ¡
  25.       
  26.      'Workbooks("·s¼W¸ê®Æ.xls").Close SaveChanges:=True '¦Û°ÊÀx¦sÃö³¬

  27. 'Next x
  28. End Sub
½Æ»s¥N½X

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

[µo°Ý] ±Ð²¾°Ê¤u§@ªí¥X²{ Class worksheetªºMove¤èªk¥¢±Ñ "104"

²¾°Ê¤u§@ªí¥X²{--°õ¶¥¬q¿ù»~'1004'--ªº¿ù»~      Class worksheetªºMove¤èªk¥¢±Ñ
  
¨Ï¥Î move  ®É¥X²{¤F¿ù»~°T®§~~~~~²¾°Ê¤u§@ªí¥X²{--°õ¶¥¬q¿ù»~'1004'--ªº¿ù»~
Workbooks("¥Dµ{¦¡.xls").Sheets("¸ê®Æªí3").Move before:=Workbooks("·s¼W¸ê®Æ.xls").Sheets("¸T§R")  '²¾°Ê   ¤u§@ªí======>¥X²{  °õ¶¥¬q¿ù»~'1004'
¨C¤@¦¸³£¥X²{¦b¦P¤@­Ó¦a¤è¡I¦ü¥G·h²¾  move¡Bcopyµ¥¥Îªk¦³¦¸¼Æªº­­¨î¡H
«çºN·|³o¼Ë¡A¦³¤°»ò¤èªk§ïµ½¶Ü¡H
¥H¤U¬°¬ÛÃö¸ê®Æ¦pªþ¥ó

¦]¬°VBA¤º®e¦³¤@¨Ç­n­pºâªº³¡¥÷¡A¤w¥ý¤©¥H§R°£¡A¦ý«O¯d¬[ºc¡A¨Ãªþ¤W°õ¦æªº¬yµ{¹Ï¡C
§Æ±æ¦U¦ì¥ý¶i¨ó§U§ïµ½°ÝÃD~~¡CÁÂÁÂ

ÁÂÁ«ü±Ð~~~~·P®¦~~~~~~~¡I:'(




°Ý°ÝÃD_102.5.7.rar (81.93 KB)

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD