- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-5-22 15:15 ½s¿è
¦^´_ 34# PJChen
¦p A=A1 A.Cells(1,1) =>A1 ,A.Offset(0,0)=>A1 ¥iÀHÓ¤H³ß¦n
¦^´_ 35# PJChen
¦³¿ù»~¬O¦] B27: RAttn:? Mr. Peter Holfelder ¤¤ ? ¬° ¤£¥i¨£¦r¤¸ 160
µ{¦¡¤w×¥¿ ²Å¦X ¦L¦C¶ªºªº®æ¦¡¶×¤J¤å¦rÀɤ¤ - Sub try()
- Windows("Shipping for Holfelder.xlsx").Activate
- 'Creat a TXT
- Sheets("Booking").Select
- 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
- With Workbooks("Shipping for Holfelder.xlsx") '½Ð§ï¦¨n½Æ»s¬¡¶Ã¯ªº¦WºÙ(¤w¸g¥´¶})
- 'With Workbooks.Open("P:\Shipping for Holfelder.xlsx") '½Ð§ï¦¨n½Æ»s¬¡¶Ã¯ªº¦WºÙ(©|¥¼¥´¶})
- Set Rng(1) = .Sheets("Booking").[B1:B40] '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) ¦sÀÉÀɦW¶·¦h¥[[A2]ªºÀx¦s®æ¦WºÙ
- 'RowOffset ¿ï¾Ü©Êªº Variant¡C¥Î¦C¼Æªí¥Üªº°Ï°ì¦ì²¾ (¥¿È¡Bt¼Æ©Î¹s (0))¡C¥¿Èªí¥Ü¦V¤U¦ì²¾¡AtȪí¥Ü¦V¤W¦ì²¾¡C¹w³]Ȭ° 0¡C
- 'ColumnOffset ¿ï¾Ü©Êªº Variant¡C¥ÎÄæ¼Æªí¥Üªº°Ï¹Bºâ¦¡°ì¦ì²¾ (¾ã¼Æ¡Bt¼Æ©Î 0 (¹s))¡C¥¿Èªí¥Ü¥k¦ì²¾¡AtȪí¥Ü¥ª¡C¹w³]Ȭ° 0¡C
- End With
- Set Fs = CreateObject("Scripting.FileSystemObject") 'FileSystemObject ª«¥ó ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
- Set A = Fs.CreateTextFile("P:\TXT\" & Rng(2) & ".txt", True) '«Ø¥ß¤å¦rÀÉ®×
- 'CreateTextFile ¤èªk «Ø¥ß¤@Ó«ü©wªºÀɦW¨Ã¥B¶Ç¦^¤@ӥΩó¸ÓÀÉ®×Ū¼gªº TextStream ª«¥ó¡C
- '¦pªG¥i³QÂл\¨äȬ° True¡A¨ä¬° False ®ÉµLªkÂл\
- 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
- 'Workbooks.Open ("P:\TXT\" & Rng(2) & ".txt") '³o·|¥HEXCEL¦Û°Ê¥´¶}TXTÃþ«¬¤å¥ó
- Shell "Cmd /c start P:\TXT\" & Rng(2) & ".txt" '¦Û°Ê¥´¶}TXTÀÉ
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|