- ©«¤l
- 6
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2022-4-13
- ³Ì«áµn¿ý
- 2022-5-25
|
¦^´_ 2# samwang
¤£¦n·N«ä»¡©úªº¤£²M·¡¡A¥Ø«e¬O·Q¶}¨âÓ¬Û¦PÀɮצý¤£¦P°ÆÀɦWCSV»PTXT¡AµM«á¦A±NTXT¸Ì±ªº¸ê®Æ½Æ»s¦bCSVÀÉ¡AµM«á¥t¦sÀɮצb¶i¦æ½ü°j¡C
¥Ø«e¸ê®Æ³B²z¨ì¥t¦sÀɮפw³B²z¦n¡A¦ý¥d¦b²Ä¤@Ãö¶}±ÒÀɮתº³¡¤À¡Aì¦]¬O·í¸ê®Æ§¨¸Ì¦³²Ä¤GÓexcelÀÉ¥H¤W®É·|¦P®É¤@°_¶}¤U¥h
¥H¤U¬O©Ò¦³ªºµ{¦¡½X:
Sub A¶}±ÒSPI_TXT()
Dim lrow As Long
Dim mFile As String
Dim Filename As String
If Len(Dir(ThisWorkbook.Path & "\TEST", vbDirectory)) = 0 Then
MkDir ThisWorkbook.Path & "\TEST"
End If
mFile = Dir(ThisWorkbook.Path & "\csvÀÉ\" & "*.csv")
Do While mFile <> ""
Workbooks.Open Filename:=ThisWorkbook.Path & "\csvÀÉ\" & mFile
mFile = Dir()
mFile = Dir(ThisWorkbook.Path & "\TXTÀÉ\" & "*.txt")
Do While mFile <> ""
Workbooks.Open Filename:=ThisWorkbook.Path & "\TXTÀÉ\" & mFile
mFile = Dir()
Loop
Loop
Run "TXT½Æ»s¦ÜCSV"
End Sub
Sub TXT½Æ»s¦ÜCSV()
Workbooks(2).Activate
Workbooks(2).Worksheets.Add Before:=Sheets(Sheets.Count)
'¬¡¶2(CSV)·s¼W¤u§@ªí
For i = 1 To Sheets.Count
Sheets(i).Name = "Sheet" & i
Next
Workbooks(3).Activate
Columns("A:A").Select
Selection.Copy
Workbooks(2).Activate
Sheets("Sheet1").Select
ActiveSheet.Paste
'±N¬¡¶3(TXT)¸ê®Æ½Æ»s¦Ü¬¡¶2(CSV)
Application.CutCopyMode = False
Workbooks(3).Close
Run "¥t¦sTESTÀÉ"
End Sub
Sub ¥t¦sTESTÀÉ()
Filename = ActiveWorkbook.Name
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\TEST\" & Filename, _
FileFormat:=xlCSV, CreateBackup:=False
Application.DisplayAlerts = True
Application.WindowState = xlNormal
'¥t¦sTEST
ActiveWindow.Close SaveChanges:=False
End Sub
ªþ¥óÀÉ®×¥i¥H¸Õ¶]¡A¦A³Â·ÐÀ°§Ú¬Ý¬Ý....ÁÂÁ |
-
-
Desktop.zip
(20.45 KB)
¸Õ¶]¥¨¶°
|