- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
½Ð°ª¤H«üÂI¡G
±¡§Î¤@,³æ¿W±Æ§Ç®É¨S°ÝÃD- Option Explicit
- Dim ¥ØªºÀÉ As Workbook, ¨Ó·½ÀÉ As Workbook
- Sub sorting()
- Dim xRng As Range
- File_settings ¥ØªºÀÉ, "ERP_Data.xlsx"
- With ¥ØªºÀÉ.Sheets("®w¦s")
- .Cells.Sort Key1:=.Columns("AD"), Key2:=.Columns("G"), Header:=xlYes
- End With
- ¥ØªºÀÉ.Save
- End Sub
- '**********¨Ó·½ÀɬO¦PVBA³øªí«ü¥Oªº¸ê®Æ§¨\FromERP\*********
- Sub File_settings(xFile As Workbook, ¤u§@¶ As String) 'Àɮ׳]©w
- Dim xPath As String
- xPath = ThisWorkbook.Path & "\"
- If UCase(¤u§@¶) <> UCase("ERP_Data.XLSX") Then xPath = xPath & "FromERP\"
- On Error Resume Next
- Set xFile = Workbooks(¤u§@¶)
- If Err > 0 Then Set xFile = Workbooks.Open(xPath & ¤u§@¶)
- If xFile.Name = "" Then
- MsgBox "½Ð¬d¬Ý " & vbLf & xPath & vbLf & "¬O§_¦³ [" & ¤u§@¶ & "]"
- End
- End If
- End Sub
½Æ»s¥N½X ±¡§Î2,¦b¥H¤U¤¤±Æ§Ç,«o¤@ª½±Æ¿ù,¬Oþ¸Ì¥X°ÝÃD¡H- Option Explicit
- Dim ¥ØªºÀÉ As Workbook, ¨Ó·½ÀÉ As Workbook
- Sub ®w¦s§ó·s()
- Dim xRng As Range
- File_settings ¨Ó·½ÀÉ, "®w¦s¸ê®Æªí.xlsx"
- File_settings ¥ØªºÀÉ, "ERP_Data.xlsx"
- '*********************************************************
- With ¨Ó·½ÀÉ.Sheets(1)
- Set xRng = .UsedRange 'UsedRange->¤u§@ªí©Ò¨Ï¥Îªº½d³ò,¦pA:AA¤§«á¦A¤]¨S¸ê®Æ
- xRng.Copy 'A:AA½Æ»s¨ì¥ØªºÀÉB:AB
- End With
- With ¥ØªºÀÉ.Sheets("®w¦s")
- .Range("B1").PasteSpecial xlPasteValues '¿ï¾Ü©Ê¶K¤W
- End With
- With ¥ØªºÀÉ.Sheets("®w¦s")
- .Cells.Sort Key1:=.Columns("AD"), Key2:=.Columns("G"), Header:=xlYes
- End With
- ¨Ó·½ÀÉ.Close False
- ¥ØªºÀÉ.Save
- End Sub
- '**********¨Ó·½ÀɬO¦PVBA³øªí«ü¥Oªº¸ê®Æ§¨\FromERP\*********
- Sub File_settings(xFile As Workbook, ¤u§@¶ As String) 'Àɮ׳]©w
- Dim xPath As String
- xPath = ThisWorkbook.Path & "\"
- If UCase(¤u§@¶) <> UCase("ERP_Data.XLSX") Then xPath = xPath & "FromERP\"
- On Error Resume Next
- Set xFile = Workbooks(¤u§@¶)
- If Err > 0 Then Set xFile = Workbooks.Open(xPath & ¤u§@¶)
- If xFile.Name = "" Then
- MsgBox "½Ð¬d¬Ý " & vbLf & xPath & vbLf & "¬O§_¦³ [" & ¤u§@¶ & "]"
- End
- End If
- End Sub
½Æ»s¥N½X |
|