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

Excel VBA «Ø¥ß ¤å¦rÀÉ

Excel VBA «Ø¥ß ¤å¦rÀÉ

¦U¦ì¥ý¶i¡A¤p§Ì¦³ªº°ÝÃD·Q½Ð±Ð¤@¤U
§Ú·Q¦bExcel¤¤¹B¥ÎVBA¼g¥X¤U¦Cªº¤å¦r,¨Ã¦bÄæ¦ì¤¤¿é¤J¥i¥HÅܧ󪺤å¦r
¨Ò¦p¡G¦bA1Äæ¦ì¤¤¿é¤Jp8p67«á«ö¤U½T»{Áä«á´N·|«Ø¥ß¤@­ÓtxtÀÉ(©Î¬O¤å¦rÀÉ)

~ Update `getnewdir` `new_dir_input` \
`p8p67-pre`
~ Activate `getnewdir` `OK_button`
~ Activate `file_open` `Open`
!%CISuccessfully changed to D:\p8p67-pre directory.
1 `Assembly`
~ Input `new` `InputPanel1` \
`p8p67-pre`
~ Update `new` `InputPanel1` \
`p8p67-pre`
~ Activate `new` `OK`

!01-Sep-10 11:41:38 Start D:\p8p67-pre\p8p67-pre.asm.1
!01-Sep-10 11:41:38 End D:\p8p67-pre\p8p67-pre.asm.1

­Y§Ú¦bA1Äæ¦ì¤¤¿é¤Jp8p58ªº¸Ü«h·|«Ø¥ß¦p¤U

~ Update `getnewdir` `new_dir_input` \
`p8p58-pre`
~ Activate `getnewdir` `OK_button`
~ Activate `file_open` `Open`
!%CISuccessfully changed to D:\p8p58-pre directory.
1 `Assembly`
~ Input `new` `InputPanel1` \
`p8p58-pre`
~ Update `new` `InputPanel1` \
`p8p58-pre`
~ Activate `new` `OK`

!01-Sep-10 11:41:38 Start D:\p8p58-pre\p8p58-pre.asm.1
!01-Sep-10 11:41:38 End D:\p8p58-pre\p8p58-pre.asm.1

¬O§_¯à°÷³o¼Ë°µ¡H¡H

³o¨Ç¶Ã¤C¤KÁVªº¦r²ÅµLªk©ñ¦bµ{¦¡½X¤¤¡A«Øij©ñ¦bÀx¦s®æ¤¤¡A°õ¦æµ{¦¡®É¥H´M§ä¨ú¥N¤è¦¡§ïÅܶ·§ïÅܪº¦r²Å¡A¦pp8p67¡A¦A¼g¤J¤å¦rÀÉ¡C

TOP

¦^´_ 1# hochoc
  1. Sub nn()
  2. mystr = "~ Update `getnewdir` `new_dir_input` \" & Chr(10) & _
  3. "`" & [A1] & "`" & Chr(10) & _
  4. "~ Activate `getnewdir` `OK_button`" & Chr(10) & _
  5. "~ Activate `file_open` `Open`" & Chr(10) & _
  6. "!%CISuccessfully changed to D:\" & [A1] & " directory." & Chr(10) & _
  7. "1 `Assembly`" & Chr(10) & _
  8. "~ Input `new` `InputPanel1` \" & Chr(10) & _
  9. "`" & [A1] & "`" & Chr(10) & _
  10. "~ Update `new` `InputPanel1` \" & Chr(10) & _
  11. "`" & [A1] & "`" & Chr(10) & _
  12. "~ Activate `new` `OK`" & Chr(10) & _
  13. "!01-Sep-10 11:41:38 Start D:\" & [A1] & "\" & [A1] & ".asm.1" & Chr(10) & _
  14. "!01-Sep-10 11:41:38 End D:\" & [A1] & "\" & [A1] & ".asm.1"
  15. Open "E:\TESTFILE.txt" For Output As #1 '¿é¥XÀɦW¦Û¦æ­×§ï
  16. For Each a In Split(mystr, Chr(10))
  17. Print #1, a
  18. Next
  19. Close #1
  20. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ hochoc ©ó 2010-9-7 19:32 ½s¿è

H­ô,§A¦n
°²¦p¦pªG§Ú¦³¤@¤d¦h±ø¹³³o¼Ëªº¦æ¦C¤å¦r¡A·í§Ú¹B¥Î§A¤W­zªº¤èªk
·|¥X²{"´«¦æ±µÄò²Å¸¹¹L¦h"ªºµøµ¡
¤p§Ì¦b·Q¡A¬O§_¤]¥i¥H¥ÎNotepad(°O¨Æ¥»)¤¤ªº¨ú¥N¥\¯à¡A¦bExcel VBA¤¤¼g¥Xµ{¦¡
¨Ò¦p¦³©T©w¦r²´¥i¥H§ä¥X¨Ó¡A¦bExcelÄæ¦ì¤¤¿é¤J©Ò­nÅܧ󪺦r²´°µ¨ú¥Nªº°µ§@
¤p§Ì¾Ç²L¡A½Ð¤£¥t§[±Ð¾É¡AÁÂÁ¡I¡I
¤£¦n·N«ä¡A¦b¸É¤Wªþ¥ó
ªþ¥ó¤¤¦³p8p67-pre¤Îxxxxx-xxx¬O©T©w¦r²´

Test.rar (876 Bytes)

TOP

¦^´_ 4# hochoc

¼Ë¥».txtªº¤º®e¥Î¯S©w¦r¥ý±N­n¥ÎA1¨ú¥Nªº¦r¤¸¨ú¥N
    ~ Update `getnewdir` `new_dir_input` \
`Àx¦s®æ¤º®e`
~ Activate `getnewdir` `OK_button`
~ Activate `file_open` `Open`
!%CISuccessfully changed to D:\Àx¦s®æ¤º®e directory.
1 `Assembly`
~ Input `new` `InputPanel1` \
`Àx¦s®æ¤º®e`
~ Update `new` `InputPanel1` \
`Àx¦s®æ¤º®e`
~ Activate `new` `OK`

!01-Sep-10 11:41:38 Start D:\Àx¦s®æ¤º®e\Àx¦s®æ¤º®e.asm.1
!01-Sep-10 11:41:38 End D:\Àx¦s®æ¤º®e\Àx¦s®æ¤º®e.asm.1
  1. Sub nn()
  2. Open "C:\¼Ë¥».txt" For Input As #1 '¼Ë¥»ªº§¹¾ã¸ô®|
  3. Open "C:\§¹¦¨.txt" For Output As #2 '¿é¥XÀɮתº§¹¾ã¸ô®|
  4. Do Until EOF(1)
  5.    Input #1, mystr
  6.    Print #2, Replace(mystr, "Àx¦s®æ¤º®e", [A1])
  7. Loop
  8. Close #1
  9. Close #2
  10. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD