返回列表 上一主題 發帖

Excel VBA 建立 文字檔

Excel VBA 建立 文字檔

各位先進,小弟有的問題想請教一下
我想在Excel中運用VBA寫出下列的文字,並在欄位中輸入可以變更的文字
例如:在A1欄位中輸入p8p67後按下確認鍵後就會建立一個txt檔(或是文字檔)

~ 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

若我在A1欄位中輸入p8p58的話則會建立如下

~ 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

是否能夠這樣做??

本帖最後由 hochoc 於 2010-9-7 19:32 編輯

H哥,你好
假如如果我有一千多條像這樣的行列文字,當我運用你上述的方法
會出現"換行接續符號過多"的視窗
小弟在想,是否也可以用Notepad(記事本)中的取代功能,在Excel VBA中寫出程式
例如有固定字眼可以找出來,在Excel欄位中輸入所要變更的字眼做取代的做作
小弟學淺,請不另吝教導,謝謝!!
不好意思,在補上附件
附件中有p8p67-pre及xxxxx-xxx是固定字眼

Test.rar (876 Bytes)

TOP

        靜思自在 : 發脾氣是短暫的發瘋。
返回列表 上一主題