- ©«¤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
|
¤£¦n·N«ä,°õ¦æÁÙ¬O¦³°ÝÃD,½Ð¤j®vÀ°¦£¬Ý¬Ý:
Dim Rng(1 To 2) As Range, Fs As Object, A As Object, E As Range
Application.ScreenUpdating = False
With Workbooks("2011 Shipping for NE.xlsx") '½Ð§ï¦¨n½Æ»s¬¡¶Ã¯ªº¦WºÙ(¤w¸g¥´¶})
Set Rng(1) = .Sheet("Booking").[B3:B35] '³o¸Ì´N°õ¦æ¤£¤U¤F
Set Rng(2) = .Sheet("Booking").[A1] 'Rng(2) ¦sÀɦWºÙªºÀx¦s®æ
End With
Set Fs = CreateObject("Scripting.FileSystemObject") 'FileSystemObject ª«¥ó ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
Set A = Fs.CreateTextFile("P:\BCM\Shipping Doc\PJ\HK Packing\" & Rng(2) & ".txt", True) '«Ø¥ß¤å¦rÀÉ®×
'CreateTextFile ¤èªk «Ø¥ß¤@Ó«ü©wªºÀɦW¨Ã¥B¶Ç¦^¤@ӥΩó¸ÓÀÉ®×Ū¼gªº TextStream ª«¥ó¡C
'¦pªG¥i³QÂл\¨äȬ° True¡A¨ä¬° False ®ÉµLªkÂл\
For Each E In Rng(1) '¨Ì§Ç³B¸Ì½Æ»s½d³òªºÀx¦s®æ
A.WriteLine (E) 'Àx¦s®æ¼g¤J¤å¦rÀÉ
Next
A.Close
Application.ScreenUpdating = True |
|