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

±qa.xls¸Ì­±¥h°õ¦æb.xlsªºcommandbutton1¡Fc.xlsªºcommandbutton1.....µ¥

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-4-14 16:46 ½s¿è

¦^´_ 10# gkld
¨C¤@­Ó¬¡­¶Ã¯ªº [§ó·s] ¦]¬¡­¶Ã¯Ãö³¬¦Ó°±¤î¤FVBAªº¹B§@
  1. 'Workbooks("004.xls").Save  µù¸Ñ±¼¤£°õ¦æ
  2. 'Workbooks("004.xls").Close µù¸Ñ±¼¤£°õ¦æ
½Æ»s¥N½X
001.xlsªº CommandButton1_Click
  1. Private Sub CommandButton1_Click()
  2.     Dim XPath As String, E As Variant
  3.     Call §ó·s
  4.     XPath = "C:\Documents and Settings\gkld\®à­±\my kp\¸ê®Æ®w\¤W¥«ÃþªÑ"
  5.     Application.ScreenUpdating = False
  6.     For Each E In Array("004.xls", "005.xls", "016.xls", "017.xls", "018.xls", "019.xls")
  7.         Run "'" & XPath & "\" & E & "'!¸ê®Æ§ó·s.§ó·s"
  8.         Workbooks(E).Close True
  9.     Next
  10.     Application.ScreenUpdating = True  '§ó·s¦¨¥\´N¥X²{ok
  11.     MsgBox "OK"
  12. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 11# GBKEE


«x¡H§Ú¥»¨Ó¤]¦³·Q¹L¬O¤£¬O¡y'Workbooks("004.xls").Close ¡z³y¦¨ªº
¦ý¬O«á¨Ó§Ú·Q
§Ú¥D­n¤£¬O¦b°õ¦æ001.xls sheet1ªºµ{§Ç¶Ü¡H
§ÚÃö³¬ªº¬O¨ä¥¦«D001.xlsªº¬¡­¶Ã¯¡AÃø¹D³o¼Ë¤]·|°±¤î¤F001.xls sheet1 VBAªº¹B§@¶Ü¡H
§Ú¯uªº¨S¦³³o¤è­±ªºÆ[©À~

TOP

        ÀR«ä¦Û¦b : ®É®É¦n¤ß´N¬O®É®É¦n¤é¡C
ªð¦^¦Cªí ¤W¤@¥DÃD