ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥Îexcel¥´¶}µ§°O¥»

¦^´_ 26# GBKEE
±z¦n,·Q½Ð°Ý:
¥H¤U¦sÀɪº¦WºÙ§Ú·Q¦A¼W¥[¤@­Ó[A2],¦ý­×§ï«á¥¨¶°«oµLªk°õ¦æ,½ÐÀ°§Ú¬Ý¬Ý»yªk¬O¤£¬O¦³»~?
        Set Rng(2) = .Sheets("Booking").[A1]               'Rng(2) ¦sÀɦWºÙªºÀx¦s®æ
        Set Rng(2) = .Sheets("Booking").[A1] & "_" & [A2]                     '­×§ï«áªº¦sÀɦWºÙ

TOP

GBKEE,
§¹¥þOK.¯u¬OÁÂÁ§A!

TOP

¦^´_ 25# PJChen
Workbooks.Open ("P:\BCM\Interim\" & Rng(2) & ".txt")
­×§ï¦¨
Shell "Cmd /c start P:\BCM\Interim\" & Rng(2) & ".txt"

TOP

GBKEE¤j¤j,
§Ú±Nµ{¦¡­×§ï«á¥i°õ¦æ,¥¦·|¨Ì«ü©w¸ô®|¦s¦¨TXTÀÉ,¦ý·í¥¦¦Û°Ê¥´¶}®É¬°¥t¤@­Ó»PTXT¦PÀɦWªºEXCELÀÉ,ÀÉ®×Ãþ«¬¬°¤å¦rÀÉ!½ÐÀ°§Ú¬Ý¬Ý­þ¸Ì¥X¤F°ÝÃD,§Ú§âÀɮפW¶Ç¤F.TKS. 2011 Shipping NE booking.zip (18.29 KB)

TOP

¦^´_ 23# PJChen
  1. Sub Ex()
  2.     Dim Rng(1 To 2) As Range, Fs As Object, A As Object, E As Range
  3.     Application.ScreenUpdating = False
  4.     With Workbooks("test")                       '½Ð§ï¦¨­n½Æ»s¬¡­¶Ã¯ªº¦WºÙ
  5.         Set Rng(1) = .Sheets("booking").[B3:B35]  'Rng(1) ¤u§@ªí­n½Æ»sªº½d³ò
  6.         Set Rng(2) = .Sheets("booking").[A1]      'Rng(2) ¦sÀɦWºÙªºÀx¦s®æ
  7.     End With
  8.     Set Fs = CreateObject("Scripting.FileSystemObject")        'FileSystemObject ª«¥ó ´£¨Ñ¹ï¹q¸£Àɮרt²Îªº¦s¨ú¡C
  9.     Set A = Fs.CreateTextFile("D:\" & Rng(2) & ".txt", True)   '«Ø¥ß¤å¦rÀÉ®×
  10.     'CreateTextFile ¤èªk «Ø¥ß¤@­Ó«ü©wªºÀɦW¨Ã¥B¶Ç¦^¤@­Ó¥Î©ó¸ÓÀÉ®×Ū¼gªº TextStream ª«¥ó¡C
  11.     '¦pªG¥i³QÂл\¨ä­È¬° True¡A¨ä¬° False ®ÉµLªkÂл\
  12.     For Each E In Rng(1)                          '¨Ì§Ç³B¸Ì½Æ»s½d³òªºÀx¦s®æ
  13.         A.WriteLine (E.Text)                           'Àx¦s®æ¼g¤J¤å¦rÀÉ
  14.     Next
  15.     A.Close
  16.     Workbooks.Open ("D:\" & Rng(2) & ".txt")
  17.     Application.ScreenUpdating = True
  18. End Sub
½Æ»s¥N½X

TOP

GBKEE,
¤ÓÁÂÁ§A¤F,¥¦¥i¥H¹B§@¥¿±`!¦ý¦³­Ó¤p°ÝÃD·Q½Ð±Ð,²{¦b¸ê®Æ¼g¤Jtxt«á,¥¦·|¦s¦b«ü©wªº¸ô®|,¦ý§Ú­n¦p¦ó¨ÏTXTÀx¦s«á¯à¦Û°Ê¥´¶}?¥i¥H³o»ò°µ¶Ü?

TOP

¦^´_ 21# PJChen
¿é¤J½d³ò¤¤¦³¿ù»~­È  ½Ð­×§ï¦p¤U
  1. For Each E In Rng(1)                          '¨Ì§Ç³B¸Ì½Æ»s½d³òªºÀx¦s®æ
  2.         A.WriteLine (E.Text)                           'Àx¦s®æ¼g¤J¤å¦rÀÉ
  3.     Next
  4.    
½Æ»s¥N½X

TOP

[attach]booking[/attach]
½Ð°Ñ¦ÒÀÉ®×.ÁÂÁÂ

2011 Shipping NE booking.zip (8.54 KB)

booking

TOP

¦^´_ 19# PJChen
¶Ç¤WÀɮ׬ݬÝ

TOP

¤j®v±z¦n,
    For Each E In Rng(1)
        A.WriteLine (E)                           '°õ¦æ¨ì³o¸Ì´N°±¤F,½ÐÀ°À°§Ú
    Next
    A.Close
    Application.ScreenUpdating = True
   
End Sub

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD