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

[µo°Ý] ¦p¦óÅýAÀÉÀx¦s¦b"XÀÉ",Åý"XÀÉ"·í§@¸ê®Æ®w

[µo°Ý] ¦p¦óÅýAÀÉÀx¦s¦b"XÀÉ",Åý"XÀÉ"·í§@¸ê®Æ®w

¥Øªº¬O: ÅýAÀÉ¥i¥H¦b«ö¤UÀx¦s«e,±N¥þ³¡ªºÀɮפº®e¦s¨ìXÀÉ·í§@¸ê®Æ®w
¦ÓXÀÉ¥­±`³£¥H°ßŪª¬ºA¶}±Ò,¨C¤­¤ÀÄÁ­«·s¶}±Ò¤@¦¸(¥Hºû«ù³Ì·sª¬ºA)=>³o­Ó³¡¥÷§Ú·|

XÀɪº¤º®e¥»¨­·|¦³AÀɪº©Ò¦³¤À­¶
°²³]¨â­ÓÀɦì¸m³£¦b  "P:\REPORT\Daily Check"
ÀɮצWºÙ¬°"A.xlsb","X.xlsb"


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Call Àx¦s«eÀx¦s¦Ü¸ê®Æ®w            '¤w¶}±ÒÀÉ®×AÀÉ,¨Ã¥B¦bAÀÉÀx¦s«e«ö¤U
End Sub

¦ý­n¦p¦ó¼¶¼g³o­Óµ{¦¡½X¥i¥H¹F¨ì³Ì§Öªº®ÄªG?
Sub Àx¦s«eÀx¦s¦Ü¸ê®Æ®w
       'µ{¦¡¤º®e
End Sub
PKKO

¦^´_ 1# PKKO
¬O³o¼Ë¶Ü?
¸Õ¸Õ¬Ý
  1. Sub Àx¦s«eÀx¦s¦Ü¸ê®Æ®w()
  2.     Dim Xpath  As String
  3.     Xpath "P:\REPORT\Daily Check\"
  4.     Workbooks("x.xlsb").Close False  'Àx¦s¶}±Ò¤¤ªºÀÉ®×,¦¹¶}±Ò¤¤ªºÀɶ·¥ýÃö³¬
  5.     Application.DisplayAlerts = False
  6.     ThisWorkbook.SaveCopyAs Xpath & "x.xlsb"  'ThisWorkbook -> ³oµ{¦¡¦b "A.xlsb"ªº±M®×¼Ò²Õ¤¤
  7.     Application.DisplayAlerts = True
  8.     Workbooks.Open Xpath & "x.xlsb", ReadOnly:=True  '¦A«×¶}±ÒÀÉ®×(°ßŪ)
  9. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

·PÁ¶Wª©¤j¤j,¤U­±¾Ç²ß¤F¥t¦s·sÀɨëD¤@©w­n¼vÅT¥»¨­ªºÀÉ®×µøµ¡
ThisWorkbook.SaveCopyAs Xpath & "x.xlsb"  'ThisWorkbook -> ³oµ{¦¡¦b "A.xlsb"ªº±M®×¼Ò²Õ¤¤

¦ý§Ú¥»¨­ªº°ÝÃD¦³­Ó¤£¦PÂI
Àɮצ³AÀÉ,BÀÉ~FÀÉ
¸ê®Æ®wªºÀÉ®×¥u¦³¤@­ÓXÀÉ(¦]¦¹¥Î¦¹¤èªk«h¤£§´)

¦óºØ¤è¦¡¦b©óAÀɪº1~10­Ó¤À­¶"Âл\"XÀɪº¬Û¦P¦WºÙ¤À­¶·|¤ñ¸û§Ö©O~?
PKKO

TOP

¦^´_ 3# PKKO

©ñ¦b¯u¥¿ªº¸ê®Æ®w«Dexcel¤¤¡A³Ì§Ö³Ìí¤S¤£®e©ö¥X¿ù

¥H«e§Ú¤]°µÃþ¦üªº¤èªk¡A¤§«áºCºC¦¨¯uªº¸ê®Æ®w´N¨S¦³¤°»ò°ÝÃD

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-12-2 08:35 ½s¿è

¦^´_ 3# PKKO
  1. Sub Àx¦s«eÀx¦s¦Ü¸ê®Æ®w()
  2.     Dim Xpath  As String, Sh(1 To 2) As Worksheet, Wo(1 To 2) As Workbook, A As Variant
  3.     Xpath = "P:\REPORT\Daily Check\"
  4.     Set Wo(1) = Workbooks("x.xlsb")
  5.     Wo(1).Close False   'Àx¦s¶}±Ò¤¤ªºÀÉ®×,¦¹¶}±Ò¤¤ªºÀɶ·¥ýÃö³¬
  6.     Set Wo(1) = Workbooks.Open(Xpath & "x.xlsb")
  7.     For Each A In Array("A.xlsb", "b.xlsb", "f.xlsb") 'Àɮצ³AÀÉ,BÀÉ~FÀÉ
  8.         Set Wo(2) = Workbooks.Open(Xpath & A)
  9.         For Each Sh(2) In Wo(2).Sheets
  10.             On Error Resume Next
  11.             Set Sh(1) = Wo(1).Sheets(Sh(2).Name)
  12.             If Err <> 0 Then
  13.                 Sh(2).Copy , Wo(1).Sheets(Wo(1).Sheets.Count)
  14.                 Err.Clear
  15.                 On Error GoTo 0
  16.             Else
  17.                 Sh(1).UsedRange.Clear
  18.                 Sh(2).UsedRange.Copy Sh(1).Range("a1")
  19.             End If
  20.         Next
  21.         Wo(2).Close False
  22.     Next
  23.     Wo(1).Close True
  24.     Workbooks.Open Xpath & "x.xlsb", ReadOnly:=True  '¦A«×¶}±ÒÀÉ®×(°ßŪ)
  25. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE


    ·PÁ¤j¤j!«Ý·|´N¨Ó¸Õ¤@¤U
PKKO

TOP

¥»©«³Ì«á¥Ñ PKKO ©ó 2014-12-2 07:57 ½s¿è

¦^´_ 5# GBKEE

¶Wª©¤j¤j,·PÁ±zªº¦^ÂÐ
¦ý¥H¤U¨â¦æµ{¦¡½X¬ÒµL¤ÏÀ³
Sh(1).UsedRange.Clear
Sh(2).Copy Sh(1).Range("a1")
¤p§Ì¹Á¸Õ¤F¤@¤U¤´µLªk¥ÎSETªº¤è¦¡¦¨¥\
¦]¦¹§ï¬°¥H¤Uµ{¦¡½X,¥Ø«e¤w¥i¥¿±`¨Ï¥Î
¦s¨ú³t«×¤j¬ù¨â¬í¥H¤º(¥i¯à¬OSHEET¤£¦hªºÃö«Y¥Ø«eÁÙº¡§Öªº)

·PÁ¤j¤j,po¤W¤p§Ì¹ê»Úªºµ{¦¡½X
  1. Sub Àx¦s«eÀx¦s¦Ü¸ê®Æ®w()
  2.     Application.ScreenUpdating = False 'Ãö³¬¿Ã¹õ
  3.     Application.DisplayAlerts = False 'Ãö³¬Äµ§iµøµ¡
  4.     Dim Xpath  As String, A As Variant, sh As Worksheet
  5.     W1 = ThisWorkbook.Name
  6.     Xpath = "C:\Users\apple\Google ¶³ºÝµwºÐ\Excel\"
  7.     Workbooks("¸ê®Æ®w.xlsb").Close False   'Àx¦s¶}±Ò¤¤ªºÀÉ®×,¦¹¶}±Ò¤¤ªºÀɶ·¥ýÃö³¬
  8.     Workbooks.Open (Xpath & "¸ê®Æ®w.xlsb")
  9.         For Each sh In Workbooks(W1).Sheets
  10.                 Workbooks("¸ê®Æ®w.xlsb").Sheets(sh.Name).UsedRange.Clear
  11.                 Workbooks(W1).Sheets(sh.Name).[a1].CurrentRegion.Copy
  12.                 Workbooks("¸ê®Æ®w.xlsb").Sheets(sh.Name).Activate'¦³ÂI¦h¾lªºµ{¦¡½X,¦ý¤£¤Ó·|§ï
  13.                 Range("a1").Select'§Ú¥u¬O­nÅý¤U­±¶K¨ìa1
  14.                 Workbooks("¸ê®Æ®w.xlsb").Sheets(sh.Name).Paste'ª½±µ¶K¤W¤£·|¶K¨ì[A1],¦]¦¹¦h¤F¤W­±¨â¦æµ{¦¡½X
  15.         Next
  16.     Workbooks("¸ê®Æ®w.xlsb").Close True
  17.     Workbooks.Open Xpath & "¸ê®Æ®w.xlsb", ReadOnly:=True  '¦A«×¶}±ÒÀÉ®×(°ßŪ)
  18.     Application.WindowState = xlMinimized '±N¸ê®Æ®w³Ì¤p¤Æ
  19.     Application.CutCopyMode = xlCopy '²M°£°Å¶Kï
  20.     Application.ScreenUpdating = True
  21.     Application.DisplayAlerts = True
  22.     MsgBox "¾Þ§@¦¨¥\"
  23. End Sub
½Æ»s¥N½X
PKKO

TOP

¦^´_ 7# PKKO

¦ý¥H¤U¨â¦æµ{¦¡½X¬ÒµL¤ÏÀ³
Sh(1).UsedRange.Clear
Sh(2).Copy Sh(1).Range("a1")
¶·§ó¥¿¬°
  1. Sh(2).UsedRange.Copy Sh(1).Range("a1")
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# GBKEE


    ­ì¨Ó¦p¦¹,·P®¦!
PKKO

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD