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

[µo°Ý] ·j´M²Å¦X±ø¥óªº­q³æ¸¹½X

[µo°Ý] ·j´M²Å¦X±ø¥óªº­q³æ¸¹½X

¤j¤j¦n,

¦b"°£¥~¤u§@ªí"k1¦³¤@­Ó«ü©wªº­q³æ¸¹½X(¥¦·|¨Ì»Ý¨D¦ÓÅܰʸ¹½X)¬°¨Ì¾Ú,¥Î¨Ó·j´MBOM,½ÐÁÊ,»â®Æ...µ¥¤u§@ªí¤¤²Å¦X¦¹­q³æ¸¹½Xªº´N±N¥þ³¡®Æ¸¹¨Ì§Ç±Æ¦C¥X,½Ð°Ý¤°»ò¨ç¼Æ¥i¥H¹F¦¨³o­Ó­n¨D?
1) ¨ä¤¤BOM¤u§@ªíFÄæ®Æ¸¹¦³®É¸ê®Æ·|ªÅ¥Õ,©Ò¥H¬O¦³ªº¸Ü¦C¥X¦b°£¥~¤u§@ªíFÄæ¦ì,¨S¦³ªº¸Ü´NªÅ¥Õ,®Æ¸¹¤£¯à­«½Æ¥X²{,¨Ã¦bF1¼Ð¥ÜÁ`¦@¦³´Xµ§¸ê®Æ»â®Æ¤u§@ªí(¥[Á`µ§¼Æ­n¨Ó¦ÛBOM¤u§@ªí)
2) ½ÐÁÊ,»â®Æ2­Ó¤u§@ªíªº¸ê®Æ¥]§t¦UºØ­q³æ¸¹½X,©Ò¥H®Æ¸¹¬O¤£·|¨Ì­q³æ¶¶§Ç¥X²{ªº
3) ½ÐÁʤu§@ªíDÄæ²Å¦X­q³æ¸¹½Xªº¸Ü,´N±N®Æ¸¹¦C¦b°£¥~¤u§@ªíGÄæ¦ì,®Æ¸¹¤£¯à­«½Æ¥X²{,¨Ã¦bg1¼Ð¥ÜÁ`¦@¦³´Xµ§¸ê®Æ(¥[Á`µ§¼Æ­n¨Ó¦Û½ÐÁʤu§@ªí)
4) »â®Æ¤u§@ªíDÄæ²Å¦X­q³æ¸¹½Xªº¸Ü,´N±N®Æ¸¹¦C¦b°£¥~¤u§@ªíJÄæ¦ì,®Æ¸¹¤£¯à­«½Æ¥X²{,¨Ã¦bj1¼Ð¥ÜÁ`¦@¦³´Xµ§¸ê®Æ(¥[Á`µ§¼Æ­n¨Ó¦Û»â®Æ¤u§@ªí)
µù:­ì¥»¤u§@ªí¤¤¸ê®Æ´X¤dµ§,¦]¬°ÀɮפӤj§R°£«Ü¦h¸ê®Æ,©Ò¥H¥i¥H¬Ý¨ìªº­q³æ¸ê®Æ¨S¦³«Ü¦h.
®Æ¸¹.rar (43.68 KB)

¦^´_ 19# GBKEE

±z¦n,
§Ú»Ý­n¤@­Ó¼Æ­È¤Æªº¥\¯à¡A·Pı¤§«e±z¼gªº³o­Óµ{¦¡³W«hÅÞ¿è¤ñ¸û±µªñ¡A¤£ª¾¥i§_À°¦£­×§ï¡H·P®¦¡I   ¼Æ­È¤Æ.rar (102.84 KB)
  1. GÄ欰¤u§@ªí¦WºÙ
  2. VBA«ü¥O¦s¦bVBA³øªí«ü¥OII.xlsm
  3. §âGÄ檺¤u§@ªí¥þ³¡¦U§O½Æ»s¤@¥÷(Àɮ׬O:ERP_Data.xlsx)
  4. ¥t¦s¦bD:\5_VBA¿é¥X³øªí\
  5. ¦sÀɦWºÙ©R¦W³W«h¬°GÄæ¤u§@ªí¦WºÙ_¦~¦~¤ë¤ë.®É®É¤À¤À
  6. µù¡GERP_Data.xlsx¦]¬°¸ê®Æ«Ü¦h¡A¬°¤FÁY¤pÀɮסA¤w¸g¹L§R´î¤Î­È¤Æ
½Æ»s¥N½X

TOP

¦^´_ 19# GBKEE

GBKEE¤j¯«...°õ¦æ§¹¥þ¨S°ÝÃD.  

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-7-30 07:53 ½s¿è

¦^´_ 18# PJChen
¦³°÷²M·¡ªº,´£°Ý´N¬O­n³o¼Ë
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Dim ¥ØªºÀÉ As Workbook, ¨Ó·½ÀÉ As Workbook
  3. Sub Copy_All()
  4.     Dim RngAr(), Rng As Range, M As Variant, xM As Long, E As Integer, Msg As String
  5.     With ThisWorkbook.Sheets("VBA«ü¥O")
  6.         RngAr = .Range("G2", .Range("G2").End(xlDown)).Resize(, 3).Value   '·Ç«h½d³ò¸m©ó°}¦CÅܼƤ¤
  7.     End With
  8.     File_settings ¥ØªºÀÉ, "ERP_Data.XLSX"
  9.     '****  ¤ñ¹ï·Ç«h ªº°j°é **************
  10.     For E = 1 To UBound(RngAr)
  11.         File_settings ¨Ó·½ÀÉ, RngAr(E, 1) & ""
  12.         M = Application.Match(RngAr(E, 2), ¨Ó·½ÀÉ.Sheets(1).Range("b:b"), 0)
  13.         If IsNumeric(M) Then
  14.             With ¨Ó·½ÀÉ.Sheets(1)
  15.                 xM = .Range("b" & M).End(xlDown).Row
  16.                Set Rng = .Range("b" & M, .Range("b" & xM)).Resize(, Range(RngAr(E, 3)).Columns.Count)
  17.                Rng.copy
  18.             End With
  19.             With ¥ØªºÀÉ.Sheets(Mid(RngAr(E, 1), 1, 2))
  20.                 M = Application.Match(RngAr(E, 2), .Range("c:c"), 0)
  21.                 If IsNumeric(M) Then
  22.                     '***¶K¤W«á½d³ò,·|¦Û°Êªº¤Ï¥Õ,¤£¶·¦³µ{¦¡½X°µ¤Ï¥Õ***
  23.                     .Range("c" & M).PasteSpecial xlPasteValues
  24.                     xM = .Range("c" & M).End(xlDown).Row  '¶K¤W«á³o¤u§@ªíªº³Ì«á¤@¦C¸¹
  25.                     M = M + Rng.Rows.Count - 1            '·Ç«h¦C¸¹+½Æ»s½d³òªº¦C¼Æ - 1
  26.                     If xM > M Then .Range("a" & M + 1, .Range("a" & xM)).EntireRow.Delete
  27.                 Else
  28.                     '***¶K¤W«á½d³ò,·|¦Û°Êªº¤Ï¥Õ,¤£¶·¦³µ{¦¡½X°µ¤Ï¥Õ***
  29.                     .Range("c1").End(xlDown).Offset(1).PasteSpecial xlPasteValues
  30.                 End If
  31.             End With
  32.             Application.CutCopyMode = False
  33.             Msg = Msg & vbLf & Mid(RngAr(E, 1), 1, 2) & vbTab & RngAr(E, 2) & vbTab & "§ó·s§¹¦¨!"
  34.         Else
  35.             Msg = Msg & vbLf & Mid(RngAr(E, 1), 1, 2) & vbTab & RngAr(E, 2) & vbTab & "¤£¥Î§ó·s!"
  36.         End If
  37.         ¨Ó·½ÀÉ.Close False
  38.     Next
  39.     ¥ØªºÀÉ.Save     '**¥ØªºÀɦsÀÉ
  40.     MsgBox IIf(Msg = "", "¨S¦³¥ô¦ó «ü©w­q³æ §ó·s", Mid(Msg, 2))
  41. End Sub
  42. '**********¨Ó·½ÀɬO¦PVBA³øªí«ü¥Oªº¸ê®Æ§¨\FromERP\*********
  43. Sub File_settings(xFile As Workbook, ¤u§@­¶ As String) 'Àɮ׳]©w
  44.     Dim xPath As String
  45.     xPath = ThisWorkbook.Path & "\"
  46.     If UCase(¤u§@­¶) <> UCase("ERP_Data.XLSX") Then xPath = xPath & "FromERP\"
  47.     On Error Resume Next
  48.     Set xFile = Workbooks(¤u§@­¶)
  49.     If Err > 0 Then Set xFile = Workbooks.Open(xPath & ¤u§@­¶)
  50.     If xFile.Name = "" Then
  51.         MsgBox "½Ð¬d¬Ý " & vbLf & xPath & vbLf & "¬O§_¦³ [" & ¤u§@­¶ & "]"
  52.         End
  53.     End If
  54. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2017-7-29 19:56 ½s¿è

¦^´_ 17# GBKEE

¤j¤j,

«e­±³\¦h¦¸ªº¹êÅç¡A·Pı¬O¦]¬°µ{¦¡»Ý¨D¤£°÷©ú½T¡A©Ò¥H°õ¦æ®É¤@ª½³£¦³¿ù»~¡A³o¦¸§Ú§â¥ØªºÀɪº¶K¤WÄæ¦ì§ï¬°¤@¼Ë,§Ú·Q³o¼Ë¤ñ¸û¦³¤@­P©Ê¡A¦Ó¥B§Ú¥i¯à­n¥Î¨ì³o­ÓÄæ¦ì¡A¥i¥HÁקK¤é«áªº­×§ï¡A¥i§_§â«e­±ªººØºØ©Ù±¼¡A­«·s¨Ó¹L¡H

·Ç«h¡G       
1..        ·Ç«h¨Ó¦ÛVBA³øªí«ü¥O.xlsm VBA«ü¥O.sheet G2:H7
2..       


       
¨Ó·½ÀɳQ½Æ»s³W«h¡G       
3..        ·Ç«h«ü©wªº³æ¸¹¬O¨Ó·½ÀÉ­n³Q½Æ»s¤º®eªº°_©lÂI(·í¦P¤@³æ¸¹¦³¦hµ§®É,¥H²Ä¤@µ§¬°°_©l·Ç«h),¤@ª½¨ì³Ì«á¤@¦C¬°µ²§ô
4..        ·Ç«h«ü©wªº³æ¸¹­Y¦b¨Ó·½Àɧ䤣¨ì¡K.´N¬O¨S¦³¤º®e­n³Q½Æ»s(ª½±µ¸õ¹L)
       
¥ØªºÀɧó·s³W«h¡G       
5..        ·Ç«h«ü©wªº³æ¸¹¤]¬O¥ØªºÀÉ­n§ó·s¤º®eªº°_©lÂI(·í¦P¤@³æ¸¹¦³¦hµ§®É,¥H²Ä¤@µ§¬°°_©l·Ç«h),¤@ª½¨ì³Ì«á¤@¦C¬°µ²§ô
        ·í§ó·s¸ê®Æ¶K¤W«á,³Ì«á¤@¦C­YÁÙ¦³¸ê®Æ,«hclear¤@¾ã¦C(¥ØªºÀÉsheet©Ò«ü©w§ó·s¤º®eªº°Ï¶¡,Column«e«á¬Ò¦³¸ê®Æ,©Ò¥H­nclear¤@¾ã¦C)


6..        ·Ç«h«ü©wªº³æ¸¹­Y¦b¥ØªºÀɧ䤣¨ì¡K.ªí¥Ü§ó·sªº¸ê®Æ¬O¥þ·sªº,´N±q¥ØªºÀɪº³Ì«á¤@¦C¶K¤W§ó·s¸ê®Æ


VBAµ{¦¡»Ý¨D¡G       
7..        ¨Ó·½ÀɤΥتºÀɪº¤º®e¦h¹è¨Ã¨S¦³¤@©w¡A©Ò¥H¤£¯à¥Î«ü©wÀx¦s®æªº¤è¦¡°µ½Æ»s.¶K¤W
8..        ¥ØªºÀɭ쥻ªº®æ¦¡¤£­n³QÂл\,©Ò¥H§ó·s®É¥u­n¶K¤W­È
9..        ©Ò¦³sheetªº³æ¸¹¦P¤@­Ó¤ëªº¤º®e¨ÃµL¶¶§Ç,¥u¦³¤é´Á¤~¦³¶¶§Ç,©Ò¥H¨Ó·½ÀɤΥتºÀɪº¤º®e³£¤£­n³Q±Æ§Ç
10..        ¨Ó·½ÀɤΥتºÀɦbµ{¦¡°õ¦æ®É­n¥i¥H¦Û°Ê§PÂ_Àɮ׬O§_¦³¶}±Ò,¥¼¶}±Ò«h¨Ï¥Î®É¦Û°Ê¥´¶}
11..        §ó·s¸ê®Æ«á,¨Ó·½Àɤ£­n¦sÀɪ½±µÃö³¬
12..        §ó·s¸ê®Æ«á,¥ØªºÀɳQ§ó·sªº¤º®e«O¯d¤Ï¶Âªº°Ï¶ô (³o­Ó¥u¬O¬°¤F¤è«KÀ˵ø³Q§ó·sªº¤º®e,¦Ó¤S¤£·|¦³®Ø½u¦s¦b,¦pªG³o­Ó³¡¥÷ªºµ{¦¡¤ÓÃø¼g,¥i¥H©¿²¤)


13..        §ó·s¸ê®Æ«á,¥ØªºÀɳ̫á¤~¦sÀɦӥB¤£­nÃö³¬
Try_20170729.part1.rar (550 KB)
Try_20170729.part2.rar (502.08 KB)

TOP

¦^´_ 16# PJChen

1.¨S¦³±Æ§Çªº»Ý¨D
  ¨Ó·½ÀÉ,¥ØªºÀɤ¤ªº³æ¸¹,³£¤£¤@©w¥u¦³¤@¦C¹ï¶Ü?
  ¨º¨Ó·½ÀÉ,¥ØªºÀɤ¤ªº³æ¸¹³£·|³sÄò±Æ¦b¤@°_¶Ü?
³o¦³Ãöµ{¦¡½Xªº½s¼g
2¤£­n¦b¥ØªºÀÉ¥[¬õ¦â®Ø½u,¦]¬°¥¦¦b¥\¯à¤W¨S¦³ªº¹ê½èªº»Ý¨D
   ¥[¬õ®Ø¬OÄ[§A¬Ý¨ì§ó·sªº¸ê®Æ¦b¨º¸Ì,
  1. With ¤u§@­¶³æ¸¹_Rng
  2.         .Value = ·Ç«h³æ¸¹_Rng.Value
  3.        '³o¥i¥H§R±¼¥¦
  4.        '.BorderAround ColorIndex:=3, Weight:=xlThick
  5.     End With
½Æ»s¥N½X
3. ¥¦¦n¹³§ó·s¸ê®Æ¨ì²ÄN¦C´N¤£¯à§ó·s,«á­±¦³¨Ç·sªº¸ê®Æ§¹¥þ¨S¦³¶K¤W
.   §Aªº½d¨Ò      ­q³æ©ú²Óªí-> MSO17020036 ¦bB2   ,B2¥H«áªº¸ê®Æ¬O·sªº¸ê®Æ¶Ü?
   ¥þ³£¶K¨ì ERP_Datqªº­q³æ¶Ü!

4. ¦h¾lªº¸ê®ÆµLªk§R°£,§Ú¤£½T©w·sªºµ{¦¡¬O§_¨S¦³³o­Ó¥\¯à¡H
  ÁÙ¨S,½Ð°Ý¦p¦ó§PÂ_¦h¾lªº¸ê®Æ
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 15# GBKEE

¤j¤j,
§Ú¿å¤F·sªºµ{¦¡¦n´X¦¸,¸£¤l¦³ÂI¿ù¶Ã¤F¡A§Ú¤£ª¾¹D©Ò°õ¦æªºµ²ªG¬O§_¯u¦p§Ú©Ò»¡¡A§Ú§â¨Ó·½Àɪº³æ¸¹³£¶K¦b¨C­Ó¥ØªºÀɪº³Ì«á¤@Äæ¥H¤è«K¨Ó¦^¤ñ¹ï¡A§Ú§â§Ú©Ò­nªº¤Î¬Ý¨ìªºµ²ªG´y­z¤@¤U...
»Ý¨D¡G
1. ³o6­Ósheet¯uªº¨S¦³±Æ§Çªº»Ý¨D,½Ð¤£­nÅý¥¦±Æ§Ç,¤£µM¸ê®Æ·|¶Ã±¼.
2. §ó·s¤§«á,¤]¤£­n¦b¥ØªºÀÉ¥[¬õ¦â®Ø½u,¦]¬°¥¦¦b¥\¯à¤W¨S¦³ªº¹ê½èªº»Ý¨D,¤£¹L¦]¬°§A³o¦¸¥[¤F®Ø½u,§Úµo²{·Ç«h¤£­nÅÜ°Ê¡A°õ¦æ¤F2¦¸¥H«á´N¦³2­Ó®Ø½u,³o¬O§_»¡©ú¥¦ªº°õ¦æµ²ªG¦³»~¡H

¬Ý¨ìªºµ²ªG¡G
3. ¥¦¦n¹³§ó·s¸ê®Æ¨ì²ÄN¦C´N¤£¯à§ó·s,«á­±¦³¨Ç·sªº¸ê®Æ§¹¥þ¨S¦³¶K¤W.
4. ¦h¾lªº¸ê®ÆµLªk§R°£,§Ú¤£½T©w·sªºµ{¦¡¬O§_¨S¦³³o­Ó¥\¯à¡H
5. §Ú¦b¥X³f.sheet¹êÅç,§R°£¤F«Ü¦h¸ê®Æ,·Q¬Ý¥¦ªº§ó·s±¡§Î¡Aµo²{¨S¦³§ó·s¥\¯à¡I

µ²½×¡G
6. ©Ò¥H¨ä¹ê§Ú¤£ª¾¹D¥¦¨ì©³¯à§_§ó·s¸ê®Æ.

Try_20170727.part1.rar (600 KB) Try_20170727.part2.rar (466.57 KB)

TOP

¦^´_ 14# PJChen

12#ªºµ{¦¡½X,¤µ¤Ñ¤w§ó·s,½Ð­«¸Õ¬Ý¬Ý,·Ç«h½Æ»s¨ì¥ØªºÀɦ³¥Î¬õ®Ø®Ø¤W.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 13# PJChen

¤j¤j,

§Ú¤µ¤Ñ¤@´ú¸Õ´N¥d¦í¤F¡A§Ú¤£ª¾¹D¦³¤°»ò¦a¤è­n­×§ï¡A©Ò¥H¥ýPO¤W¨Óµ¹§A¬Ý...
ÁöµM§R¤F«Ü¦h¸ê®Æ,ÀÉ®×ÁÙ¬O¶W¹L1MB,©Ò¥H§Ú¦³¤À³Î¦A¤W¶Ç.

Try_20170726.part1.rar (600 KB)
Try_20170726.part2.rar (463.64 KB)

TOP

¦^´_ 12# GBKEE


¤j¤j,
§Ú¬D¤F¨ä¤¤¤@­ÓÀɨӻ¡©ú...
§Ú¬ÝµÛ¥¦°õ¦æ´X¦¸¡Aªì®É¦³ÂI¬Ý¤£À´¡A¦]¬°¨Ó·½ÀɤΥتºÀɪº¸ê®Æ³£¹ï¤£¤W¡A¦Ó¥B¥¦°õ¦æ¹Lµ{¤¤¤@ª½¦b¦sÀÉ¡C«á¨Ó§Úª½±µ§â¨Ó·½ÀɤΥتºÀɪº³æ¾Ú¸¹½X¶K¦b¤@°_¤ñ¹ï¡Aµo²{¦p¤U¡G
1) ¥ØªºÀɪº¸ê®Æ³Q±Æ§Ç¹L¡A¦Ó¥B¥u¦³³æ¸¹±Æ§Ç¡A¨ä¥LªºÄæ¨S¦³¸òµÛÅÜ°Ê¡A©Ò¥H¸ê®Æ¿ù¶Ã(¨ä¹ê§Ú¤£­n¸ê®Æ±Æ§Ç¡A§Ú¥u­n«ö­ì¸ê®Æ¶K¤W¦Ó¥B¬O¶K¤W­È´N¦n)
2) ¥ØªºÀɪº¸ê®Æ¸ò¤§«e¤@¼Ë,·í¨Ó·½Àɸê®Æ¤ñ¸û¤Ö®É,¥¦µLªkDelete¦h¾lªº¸ê®Æ (§Ú¤@ª½¦b«ä¦Ò³o­Ó°ÝÃD,¦pªG³o­Ó³¡¥÷ªºµ{¦¡«ÜÃø¹F¦¨¡A°®¯Ü©Ò¦³ªºÀɮצb§ó·s¸ê®Æ«á¡A©Ò¦³¶K¤Wªº¸ê®Æ³£ºû«ù¤Ï¶Âªºª¬ºA¡A·N«ä´N¹³¤U­±ªº¹ÏÀÉ¡A§ó·sªº¸ê®Æ¬OB:BF15747,Åý¤Ï¶Â«O¯d¤U¨Ó,§Ú¤@¬Ý´Nª¾¹D­þ­Ó°Ï¶ô¬O§ó·s¹Lªº¡A§Ú¦A¤â°ÊDelete 15748:15755¡A§Aı±o³o¼Ë¦p¦ó¡H·|¤£·|¤ñ¸û¦n¼g¡H


3) °õ¦æ¹Lµ{¤¤¤@ª½¦b¦sÀÉ¡A³o­Ó³¡¥÷§Ú·Q¥u­n³Ì«á¦sÀÉ´N¦n¤F¡A¤£µMÀɮפj¤Ï¦Óªá®É¶¡¤@ª½¦bµ¥«Ý¡A¦Ó¥B§Ú·QERP_Data.xlsx §Ú¤@ª½³£¦b¨Ï¥Î¡A§ï¬°¦sÀɫᤣÃö³¬.
4) ...¨ä¹ê§Ú¤]·w¤F¡A¤£ª¾¹D«ç»ò¦^ÂФñ¸û¦n¡Aµ¥§ï¦n¥H¤W³o¨Ç§Ú¦Atry¬Ý¬Ý¦³¤°»ò°ÝÃD§a.
5) ÁÙ¦³Y...§Ú¤§«e¤G­Ó¦³ÃöÁpªºµo°Ý©ñ¦b¦P¤@­Ó¥DÃD¤¤³£³Q§A§R°£¤F¡A§Ú¤S­n­«·sµo°Ý¤F¡A§Ú¤w¸g¥ý±N¨ä¤¤¤@­Ó¸û²³æªº¥ýPO¤W¥h¡A¥t¤@­Ó¥¿¦n§Ú¦b§@·~·í¤¤¡Aµo²{»Ý¨D¦³ÅÜ°Ê¡Aµ¥§Ú·Q¦n¤F½T©w­n«ç»ò°õ¦æ¦APO¤W§a¡A·íµM§Ú·|¥Î¥t¤@­Ó¥DÃD¡A¤£·|²V¦b¤@°_Åý§Aµo©ü¤F¡C

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD