- ©«¤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
|
¦^´_ 23# PJChen - Sub Ex()
- Dim Rng(1 To 2) As Range, Fs As Object, A As Object, E As Range
- Application.ScreenUpdating = False
- With Workbooks("test") '½Ð§ï¦¨n½Æ»s¬¡¶Ã¯ªº¦WºÙ
- Set Rng(1) = .Sheets("booking").[B3:B35] 'Rng(1) ¤u§@ªín½Æ»sªº½d³ò
- Set Rng(2) = .Sheets("booking").[A1] 'Rng(2) ¦sÀɦWºÙªºÀx¦s®æ
- End With
- Set Fs = CreateObject("Scripting.FileSystemObject") 'FileSystemObject ª«¥ó ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
- Set A = Fs.CreateTextFile("D:\" & 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.Text) 'Àx¦s®æ¼g¤J¤å¦rÀÉ
- Next
- A.Close
- Workbooks.Open ("D:\" & Rng(2) & ".txt")
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|