| ©«¤l913 ¥DÃD150 ºëµØ0 ¿n¤À1089 ÂI¦W0  §@·~¨t²Îwin10 ³nÅ骩¥»office 2019 ¾\ŪÅv50 ©Ê§O¤k µù¥U®É¶¡2011-8-28 ³Ì«áµn¿ý2023-7-19 
  
 | 
                
| ¦^´_ 9# GBKEE 
 ¤j¤j,
 
 §Ú¸ÕµÛ×§ï¤F¤@³¡¥÷µ{¦¡,µ{¦¡ªº¥Î·N¦b¥H"¶Kñ¦W.xlsm"ªº"EX" sheetªº«ü©wÀx¦s®æD3¤ºªºÀɦW,°õ¦æ"TXT"ªº¥¨¶°,²{¦b¥¦¥i¥H°õ¦æ¥¨¶°,¦ý¥X²{¤FÓ¿ù»~,¥i§_À°¦£«üÂI? ..¥ýÁÂÁ¤F.
 µ{¦¡°õ¦æ®É,À³¸Ó±N Shipping for ACE.xlsxªº"Booking" sheetªº¸ê®Æcopy ¨ìTXT¤¤,²{¦b¥¦ÁöµM°µ¨ì¤F,¥i¬O³s¦P"¶Kñ¦W.xlsm"ªº"EX" sheet¤]¦³copyªº°Ê§@(¾ãµÛ¤u§@ªí¥X²{copy«áªºµê½u°{°Ê),§Ú¸Ó¦p¦ó×§ï,Åý¥¦¤£n°õ¦æ¤£¥¿½Tªºcopy°Ê§@?
 
 ¥H¤U¬O×§ï§¹«áªºµ{¦¡:
 ½Æ»s¥N½XSub txt()
With Workbooks(Workbooks("¶Kñ¦W.xlsm").Worksheets("EX").Range("D3").Value)  '§ï³o¸Ì...
'Creat a TXT
With .Sheets("Booking")
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Dim Rng(1 To 2) As Range, Fs As Object, A As Object, E As Range
Dim S As Variant, xS As Variant
Application.ScreenUpdating = False
End With
End With
With Workbooks(Workbooks("¶Kñ¦W.xlsm").Worksheets("EX").Range("D3").Value)  '§ï³o¸Ì...
Set Rng(1) = .Sheets("Booking").[B1:B45] 'Rng(1) ¤u§@ªín½Æ»sªº½d³ò
Set Rng(2) = .Sheets("Booking").[A1] 'Rng(2) ¦sÀɦWºÙªºÀx¦s®æ
Rng(2) = Rng(2) & "_" & Rng(2).Offset(1) & "_" & Rng(2).Offset(2) 'Rng(2) ¦sÀÉÀɦW¶·¦h¥[[A2]ªºÀx¦s®æ¦WºÙ
End With
Set Fs = CreateObject("Scripting.FileSystemObject") 'FileSystemObject ª«¥ó ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
Set A = Fs.CreateTextFile("P:\TXT\" & Rng(2) & ".txt", True) '«Ø¥ß¤å¦rÀÉ®×
Debug.Print Rng(1).Cells(27)  'Debug.Print :§Y®É¹Bºâµøµ¡ ¥i¨£¨ì RAttn:? Mr. Peter Holfelder ¤¤ ? ¬° ¤£¥i¨£¦r¤¸ 160"
Rng(1).Replace ChrW(160), ""   '®ø°£¤£¥i¦r¤¸ 160
For Each E In Rng(1) '¨Ì§Ç³B¸Ì½Æ»s½d³òªºÀx¦s®æ
S = Split(E, Chr(10))
If UBound(S) > -1 Then '***¦³´«¦æ ªº¤å¦r
For Each xS In S
A.WriteLine (xS) 'Àx¦s®æ¼g¤J¤å¦rÀÉ
Next
Else
A.WriteLine (E.Text) 'Àx¦s®æ¼g¤J¤å¦rÀÉ
End If
Next
A.Close
Shell "Cmd /c start P:\TXT\" & Rng(2) & ".txt" '¦Û°Ê¥´¶}TXTÀÉ
Application.ScreenUpdating = True
End Sub
 | 
 |